46 lines
1.6 KiB
Plaintext
46 lines
1.6 KiB
Plaintext
$OpenBSD: patch-imap_mkimapdcert_in,v 1.5 2004/07/01 12:19:35 avsm Exp $
|
|
--- imap/mkimapdcert.in.orig 2004-05-16 14:41:01.000000000 +1000
|
|
+++ imap/mkimapdcert.in 2004-05-16 14:52:55.000000000 +1000
|
|
@@ -12,27 +12,28 @@
|
|
test -x @OPENSSL@ || exit 0
|
|
|
|
prefix="@prefix@"
|
|
+SSLDIR="/etc/ssl/private"
|
|
|
|
-if test -f @datadir@/imapd.pem
|
|
+if test -f ${SSLDIR}/imapd.pem
|
|
then
|
|
- echo "@datadir@/imapd.pem already exists."
|
|
+ echo "${SSLDIR}/imapd.pem already exists."
|
|
exit 1
|
|
fi
|
|
|
|
-cp /dev/null @datadir@/imapd.pem
|
|
-chmod 600 @datadir@/imapd.pem
|
|
-chown @mailuser@ @datadir@/imapd.pem
|
|
+cp /dev/null ${SSLDIR}/imapd.pem
|
|
+chmod 600 ${SSLDIR}/imapd.pem
|
|
+chown @mailuser@ ${SSLDIR}/imapd.pem
|
|
|
|
cleanup() {
|
|
- rm -f @datadir@/imapd.pem
|
|
- rm -f @datadir@/imapd.rand
|
|
+ rm -f ${SSLDIR}/imapd.pem
|
|
+ rm -f ${SSLDIR}/imapd.rand
|
|
exit 1
|
|
}
|
|
|
|
-cd @datadir@
|
|
-dd if=@RANDOMV@ of=@datadir@/imapd.rand count=1 2>/dev/null
|
|
+cd ${SSLDIR}
|
|
+dd if=@RANDOMV@ of=${SSLDIR}/imapd.rand count=1 2>/dev/null
|
|
@OPENSSL@ req -new -x509 -days 365 -nodes \
|
|
- -config @sysconfdir@/imapd.cnf -out @datadir@/imapd.pem -keyout @datadir@/imapd.pem || cleanup
|
|
-@OPENSSL@ gendh -rand @datadir@/imapd.rand 512 >>@datadir@/imapd.pem || cleanup
|
|
-@OPENSSL@ x509 -subject -dates -fingerprint -noout -in @datadir@/imapd.pem || cleanup
|
|
-rm -f @datadir@/imapd.rand
|
|
+ -config @sysconfdir@/imapd.cnf -out ${SSLDIR}/imapd.pem -keyout ${SSLDIR}/imapd.pem || cleanup
|
|
+@OPENSSL@ gendh -rand ${SSLDIR}/imapd.rand 512 >>${SSLDIR}/imapd.pem || cleanup
|
|
+@OPENSSL@ x509 -subject -dates -fingerprint -noout -in ${SSLDIR}/imapd.pem || cleanup
|
|
+rm -f ${SSLDIR}/imapd.rand
|