openbsd-ports/mail/courier-imap/patches/patch-imap_mkpop3dcert_in

44 lines
1.5 KiB
Plaintext

$OpenBSD: patch-imap_mkpop3dcert_in,v 1.2 2004/07/01 12:19:35 avsm Exp $
--- imap/mkpop3dcert.in.orig 2004-05-16 14:49:25.000000000 +1000
+++ imap/mkpop3dcert.in 2004-05-16 14:56:32.000000000 +1000
@@ -12,26 +12,27 @@
test -x @OPENSSL@ || exit 0
prefix="@prefix@"
+SSLDIR=/etc/ssl/private
-if test -f @datadir@/pop3d.pem
+if test -f ${SSLDIR}/pop3d.pem
then
- echo "@datadir@/pop3d.pem already exists."
+ echo "${SSLDIR}/pop3d.pem already exists."
exit 1
fi
-cp /dev/null @datadir@/pop3d.pem
-chmod 600 @datadir@/pop3d.pem
-chown @mailuser@ @datadir@/pop3d.pem
+cp /dev/null ${SSLDIR}/pop3d.pem
+chmod 600 ${SSLDIR}/pop3d.pem
+chown @mailuser@ ${SSLDIR}/pop3d.pem
cleanup() {
- rm -f @datadir@/pop3d.pem
- rm -f @datadir@/pop3d.rand
+ rm -f ${SSLDIR}/pop3d.pem
+ rm -f ${SSLDIR}/pop3d.rand
exit 1
}
-dd if=@RANDOMV@ of=@datadir@/pop3d.rand count=1 2>/dev/null
+dd if=@RANDOMV@ of=${SSLDIR}/pop3d.rand count=1 2>/dev/null
@OPENSSL@ req -new -x509 -days 365 -nodes \
- -config @sysconfdir@/pop3d.cnf -out @datadir@/pop3d.pem -keyout @datadir@/pop3d.pem || cleanup
-@OPENSSL@ gendh -rand @datadir@/pop3d.rand 512 >>@datadir@/pop3d.pem || cleanup
-@OPENSSL@ x509 -subject -dates -fingerprint -noout -in @datadir@/pop3d.pem || cleanup
-rm -f @datadir@/pop3d.rand
+ -config @sysconfdir@/pop3d.cnf -out ${SSLDIR}/pop3d.pem -keyout ${SSLDIR}/pop3d.pem || cleanup
+@OPENSSL@ gendh -rand ${SSLDIR}/pop3d.rand 512 >>${SSLDIR}/pop3d.pem || cleanup
+@OPENSSL@ x509 -subject -dates -fingerprint -noout -in ${SSLDIR}/pop3d.pem || cleanup
+rm -f ${SSLDIR}/pop3d.rand