]> git.pld-linux.org Git - packages/courier.git/blob - courier-certs.patch
perl 5.38.0 rebuild
[packages/courier.git] / courier-certs.patch
1 diff -urN courier-0.64.2.orig//courier/configure.in courier-0.64.2/courier/configure.in
2 --- courier-0.64.2.orig//courier/configure.in   2010-01-09 22:13:40.000000000 +0100
3 +++ courier-0.64.2/courier/configure.in 2010-05-08 23:31:10.355976183 +0200
4 @@ -480,6 +480,12 @@
5  eval "datarootdir=$datarootdir"
6  eval "bindir=$bindir"
7  eval "localstatedir=$localstatedir"
8 +eval "datadir=$datadir"
9 +
10 +AC_ARG_WITH(certsdir, [ --with-certsdir Directory where certs are created ],
11 +certsdir="$withval", certsdir=$datadir)
12 +
13 +AC_SUBST(certsdir)
14  
15  MAILDROP="$bindir/maildrop"
16  AC_SUBST(MAILDROP)
17 diff -urN courier-0.64.2.orig//courier/imapd-ssl.rc.in courier-0.64.2/courier/imapd-ssl.rc.in
18 --- courier-0.64.2.orig//courier/imapd-ssl.rc.in        2010-05-08 23:30:54.599915374 +0200
19 +++ courier-0.64.2/courier/imapd-ssl.rc.in      2010-05-08 23:31:10.355976183 +0200
20 @@ -28,6 +28,11 @@
21  
22  case $1 in
23  start)
24 +        # If we do not have a certificate, make one up.
25 +        if [ ! -f @certsdir@/imapd.pem ]; then
26 +        @sbindir@/mkimapdcert
27 +        fi
28 +
29         umask $IMAP_UMASK
30         @ULIMIT@ $IMAP_ULIMITD
31         @SETENV@ -i @SHELL@ -c " set -a ;
32 diff -urN courier-0.64.2.orig//courier/module.esmtp/configure.in courier-0.64.2/courier/module.esmtp/configure.in
33 --- courier-0.64.2.orig//courier/module.esmtp/configure.in      2008-07-12 22:17:24.000000000 +0200
34 +++ courier-0.64.2/courier/module.esmtp/configure.in    2010-05-08 23:31:10.355976183 +0200
35 @@ -287,6 +287,11 @@
36  AC_SUBST(mydatadir)   # Quell automake warning
37  
38  
39 +AC_ARG_WITH(certsdir, [  --with-certsdir Directory where certs are created ],
40 +certsdir="$withval", certsdir=$datadir)
41 +
42 +AC_SUBST(certsdir)
43 +
44  dnl
45  dnl  Check what libraries are available
46  dnl
47 diff -urN courier-0.64.2.orig//courier/module.esmtp/esmtpd.dist.in courier-0.64.2/courier/module.esmtp/esmtpd.dist.in
48 --- courier-0.64.2.orig//courier/module.esmtp/esmtpd.dist.in    2010-02-02 23:30:00.000000000 +0100
49 +++ courier-0.64.2/courier/module.esmtp/esmtpd.dist.in  2010-05-08 23:31:10.355976183 +0200
50 @@ -242,7 +242,7 @@
51  #
52  # This is an experimental feature.
53  
54 -TLS_CERTFILE=@mydatadir@/esmtpd.pem
55 +TLS_CERTFILE=@certsdir@/esmtpd.pem
56  
57  ##NAME: TLS_TRUSTCERTS:0
58  #
59 diff -urN courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.dist.in courier-0.64.2/courier/module.esmtp/esmtpd-ssl.dist.in
60 --- courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.dist.in        2010-02-02 23:30:00.000000000 +0100
61 +++ courier-0.64.2/courier/module.esmtp/esmtpd-ssl.dist.in      2010-05-08 23:31:10.355976183 +0200
62 @@ -269,7 +269,7 @@
63  #
64  # This is an experimental feature.
65  
66 -TLS_CERTFILE=@mydatadir@/esmtpd.pem
67 +TLS_CERTFILE=@certsdir@/esmtpd.pem
68  
69  ##NAME: TLS_TRUSTCERTS:0
70  #
71 diff -urN courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.in courier-0.64.2/courier/module.esmtp/esmtpd-ssl.in
72 --- courier-0.64.2.orig//courier/module.esmtp/esmtpd-ssl.in     2010-05-08 23:30:54.612778263 +0200
73 +++ courier-0.64.2/courier/module.esmtp/esmtpd-ssl.in   2010-05-08 23:31:10.355976183 +0200
74 @@ -25,6 +25,10 @@
75  
76  case $1 in
77  start)
78 +       # If we do not have a certificate, make one up.
79 +       if [ ! -f @certsdir@/esmtpd.pem ]; then
80 +       @sbindir@/mkesmtpdcert
81 +       fi
82         ;;
83  stop)
84         ${sbindir}/couriertcpd -pid=$SSLPIDFILE -stop
85 diff -urN courier-0.64.2.orig//courier/module.esmtp/mkesmtpdcert.in courier-0.64.2/courier/module.esmtp/mkesmtpdcert.in
86 --- courier-0.64.2.orig//courier/module.esmtp/mkesmtpdcert.in   2007-11-04 22:17:03.000000000 +0100
87 +++ courier-0.64.2/courier/module.esmtp/mkesmtpdcert.in 2010-05-08 23:31:10.355976183 +0200
88 @@ -16,38 +16,38 @@
89         test -x @CERTTOOL@ || exit 0
90  fi
91  
92 -if test -f @mydatadir@/esmtpd.pem
93 +if test -f @certsdir@/esmtpd.pem
94  then
95 -       echo "@mydatadir@/esmtpd.pem already exists."
96 +       echo "@certsdir@/esmtpd.pem already exists."
97         exit 1
98  fi
99  
100  cleanup() {
101 -       rm -f @mydatadir@/esmtpd.rand
102 -       rm -f @mydatadir@/esmtpd.pem
103 -       rm -f @mydatadir@/esmtpd.key
104 -       rm -f @mydatadir@/esmtpd.cert
105 +       rm -f @certsdir@/esmtpd.rand
106 +       rm -f @certsdir@/esmtpd.pem
107 +       rm -f @certsdir@/esmtpd.key
108 +       rm -f @certsdir@/esmtpd.cert
109         exit 1
110  }
111  
112 -cd @mydatadir@
113 +cd @certsdir@
114  
115  if test "@ssllib@" = "openssl"
116  then
117 -       cp /dev/null @mydatadir@/esmtpd.pem
118 -       chmod 600 @mydatadir@/esmtpd.pem
119 -       chown @mailuser@ @mydatadir@/esmtpd.pem
120 -       dd if=@RANDOMV@ of=@mydatadir@/esmtpd.rand count=1 2>/dev/null
121 +       cp /dev/null @certsdir@/esmtpd.pem
122 +       chmod 600 @certsdir@/esmtpd.pem
123 +       chown @mailuser@ @certsdir@/esmtpd.pem
124 +       dd if=@RANDOMV@ of=@certsdir@/esmtpd.rand count=1 2>/dev/null
125         @OPENSSL@ req -new -x509 -days 365 -nodes \
126 -                 -config @sysconfdir@/esmtpd.cnf -out @mydatadir@/esmtpd.pem -keyout @mydatadir@/esmtpd.pem || cleanup
127 -       @OPENSSL@ gendh -rand @mydatadir@/esmtpd.rand 512 >>@mydatadir@/esmtpd.pem || cleanup
128 -       @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @mydatadir@/esmtpd.pem || cleanup
129 -       rm -f @mydatadir@/esmtpd.rand
130 +                 -config @sysconfdir@/esmtpd.cnf -out @certsdir@/esmtpd.pem -keyout @certsdir@/esmtpd.pem || cleanup
131 +       @OPENSSL@ gendh -rand @certsdir@/esmtpd.rand 512 >>@certsdir@/esmtpd.pem || cleanup
132 +       @OPENSSL@ x509 -subject -dates -fingerprint -noout -in @certsdir@/esmtpd.pem || cleanup
133 +       rm -f @certsdir@/esmtpd.rand
134  else
135 -       cp /dev/null @mydatadir@/esmtpd.key
136 -       chmod 600 @mydatadir@/esmtpd.key
137 -       cp /dev/null @mydatadir@/esmtpd.cert
138 -       chmod 600 @mydatadir@/esmtpd.cert
139 +       cp /dev/null @certsdir@/esmtpd.key
140 +       chmod 600 @certsdir@/esmtpd.key
141 +       cp /dev/null @certsdir@/esmtpd.cert
142 +       chmod 600 @certsdir@/esmtpd.cert
143  
144         @CERTTOOL@ --generate-privkey --outfile esmtpd.key
145         @CERTTOOL@ --generate-self-signed --load-privkey esmtpd.key --outfile esmtpd.cert --template @sysconfdir@/esmtpd.cnf
146 diff -urN courier-0.64.2.orig//courier/pop3d-ssl.in courier-0.64.2/courier/pop3d-ssl.in
147 --- courier-0.64.2.orig//courier/pop3d-ssl.in   2010-05-08 23:30:54.612778263 +0200
148 +++ courier-0.64.2/courier/pop3d-ssl.in 2010-05-08 23:31:10.355976183 +0200
149 @@ -29,6 +29,11 @@
150  
151  case $1 in
152  start)
153 +        # If we do not have a certificate, make one up.
154 +        if [ ! -f @certsdir@/pop3d.pem ]; then
155 +        @sbindir@/mkpop3dcert
156 +        fi
157 +
158         exec @SETENV@ -i PATH="$PATH" SHELL="$SHELL" \
159                 @SHELL@ -c " set -a ; \
160                 prefix=@prefix@ ; \
161 diff -urN courier-0.64.2.orig//courier.sysvinit.in courier-0.64.2/courier.sysvinit.in
162 --- courier-0.64.2.orig//courier.sysvinit.in    2010-05-08 23:30:54.612778263 +0200
163 +++ courier-0.64.2/courier.sysvinit.in  2010-05-08 23:31:10.355976183 +0200
164 @@ -18,7 +18,7 @@
165  sbindir="@sbindir@"
166  bindir="@bindir@"
167  libexecdir="@libexecdir@"
168 -datadir="@datadir@"
169 +certsdir="@certsdir@"
170  
171  if test ! -f ${sysconfdir}/esmtpd
172  then
173 @@ -85,7 +85,7 @@
174         then
175  # If we do not have a certificate, make one up.
176  
177 -               if test ! -f ${datadir}/esmtpd.pem
178 +               if test ! -f ${certsdir}/esmtpd.pem
179                 then
180                         if test -x $COURIERTLS
181                         then
182 @@ -152,7 +152,7 @@
183                         then
184  # If we do not have a certificate, make one up.
185  
186 -                               if test ! -f ${datadir}/pop3d.pem
187 +                               if test ! -f ${certsdir}/pop3d.pem
188                                 then
189                                         echo -n " generating-POP3-SSL-certificate..."
190  
191 @@ -182,7 +182,7 @@
192                         then
193  # If we do not have a certificate, make one up.
194  
195 -                               if test ! -f ${datadir}/imapd.pem
196 +                               if test ! -f ${certsdir}/imapd.pem
197                                 then
198                                         echo -n " generating-IMAP-SSL-certificate..."
199  
This page took 0.113275 seconds and 3 git commands to generate.