$OpenBSD: patch-imap_mkimapdcert_in,v 1.6 2006/11/03 16:19:56 mbalmer Exp $ --- imap/mkimapdcert.in.orig Mon Aug 1 00:35:38 2005 +++ imap/mkimapdcert.in Mon Aug 1 00:37:31 2005 @@ -12,28 +12,29 @@ 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 umask 077 -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