Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2009 15:08:57 +0900
From:      Hirohisa Yamaguchi <umq@ueo.co.jp>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/130363: [maintainer] mail/dkim-milter: modify rc.d script like example in Porters Handbook
Message-ID:  <86ocyeidc6.wl%umq@ueo.co.jp>
Resent-Message-ID: <200901110610.n0B6A2Y7097230@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         130363
>Category:       ports
>Synopsis:       [maintainer] mail/dkim-milter: modify rc.d script like example in Porters Handbook
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 11 06:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Hirohisa Yamaguchi
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: FreeBSD calliope.****.org 8.0-CURRENT FreeBSD 8.0-CURRENT #17: Thu Jul 10 06:27:38 JST 2008 root@calliope.****.org:/usr/obj/usr/src/sys/CALLIOPE64 amd64

>Description:
	%%PREFIX%%/etc/rc.d/milter-dkim stript overrides blank definitions
	in /etc/rc.conf with default values.

	Not overriding blank definitions is preferred, as in Porters Handbook.
	http://www.freebsd.org/doc/en/books/porters-handbook/rc-scripts.html

	(pointed by netchild@)
>How-To-Repeat:
	1. write a line following in /etc/rc.conf
	milterdkim_cfgfile=""

	2. touch /etc/mail/dkim-filter.conf

	3. /usr/local/etc/rc.d/milter-dkim start

	4. ps `pgrep dkim-filter`
	 PID  TT  STAT      TIME COMMAND
	  ??  ??  Is     0:00.07 /usr/local/libexec/dkim-filter -l -u mailnull -P /var/run/milterdkim/pid -x /usr/local/etc/mail/dkim-filter.conf

	milter_cfgfile cannot be set blank.
>Fix:

	the patch follows:

cvs diff: Diffing .
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/dkim-milter/Makefile,v
retrieving revision 1.55
diff -p -u -r1.55 Makefile
--- Makefile	9 Jan 2009 23:09:17 -0000	1.55
+++ Makefile	11 Jan 2009 05:43:04 -0000
@@ -198,7 +198,7 @@ SITE_SUB+=	-e '/-DQUERY_CACHE/s/^dnl //g
 .if defined(WITH_VERIFY_DOMAINKEYS) && !defined(WITHOUT_VERIFY_DOMAINKEYS)
 LIBDK_PORT=	mail/dk-milter
 BUILD_DEPENDS+=	${NONEXISTENT}:${PORTSDIR}/${LIBDK_PORT}:patch
-LIBDK_PATH!=	cd ${PORTSDIR}/${LIBDK_PORT} && ${MAKE} -V WRKSRC
+LIBDK_PATH_CMD=	cd ${PORTSDIR}/${LIBDK_PORT} && ${MAKE} -V WRKSRC
 SITE_SUB+=	-e '\|bld_VERIFY_DOMAINKEYS|s/^dnl //'
 PORTDOCS+=	rfc4870.txt
 .endif
@@ -274,8 +274,8 @@ post-patch:
 
 pre-configure:
 .if defined(WITH_VERIFY_DOMAINKEYS) && !defined(WITHOUT_VERIFY_DOMAINKEYS)
-	${LN} -s ${LIBDK_PATH}/libdk ${WRKSRC}/
-	${CP} ${LIBDK_PATH}/rfc4870.txt ${WRKSRC}/
+	${LN} -s $$(${LIBDK_PATH_CMD})/libdk ${WRKSRC}/
+	${CP} $$(${LIBDK_PATH_CMD})/rfc4870.txt ${WRKSRC}/
 .endif
 
 post-install:
cvs diff: Diffing files
Index: files/milter-dkim.sh.in
===================================================================
RCS file: /home/ncvs/ports/mail/dkim-milter/files/milter-dkim.sh.in,v
retrieving revision 1.14
diff -p -u -r1.14 milter-dkim.sh.in
--- files/milter-dkim.sh.in	28 Jul 2008 20:15:40 -0000	1.14
+++ files/milter-dkim.sh.in	11 Jan 2009 05:43:05 -0000
@@ -30,22 +30,6 @@
 # milterdkim_selector (str):  Selector to use when signing
 # milterdkim_alg (str):       Algorithm to use when signing
 # milterdkim_flags (str):     Flags passed to start command.
-#
-# DO NOT CHANGE THESE DEFAULT VALUES HERE
-#
-milterdkim_enable=${milterdkim_enable:-"NO"}
-milterdkim_uid=${milterdkim_uid:-"mailnull"}
-milterdkim_profiles=${milterdkim_profiles:-}
-milterdkim_cfgfile=${milterdkim_cfgfile:-"%%PREFIX%%/etc/mail/dkim-filter.conf"}
-
-milterdkim_socket=${milterdkim_socket:-}
-milterdkim_domain=${milterdkim_domain:-}
-milterdkim_key=${milterdkim_key:-}
-milterdkim_selector=${milterdkim_selector:-}
-milterdkim_alg=${milterdkim_alg:-}
-# Options other than above can be set with $milterdkim_flags.
-# see dkim-milter documentation for detail.
-milterdkim_flags=${milterdkim_flags:-}
 
 . %%RC_SUBR%%
 
@@ -60,6 +44,23 @@ pidfile="${_piddir}/pid"
 
 load_rc_config $name
 
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+: ${milterdkim_enable="NO"}
+: ${milterdkim_uid="mailnull"}
+: ${milterdkim_profiles=""}
+: ${milterdkim_cfgfile="%%PREFIX%%/etc/mail/dkim-filter.conf"}
+
+: ${milterdkim_socket=""}
+: ${milterdkim_domain=""}
+: ${milterdkim_key=""}
+: ${milterdkim_selector=""}
+: ${milterdkim_alg=""}
+# Options other than above can be set with $milterdkim_flags.
+# see dkim-milter documentation for detail.
+:milterdkim_flags=${milterdkim_flags=""}
+
 if [ -n "$2" ]; then
     profile="$2"
     if [ "x${milterdkim_profiles}" != "x" ]; then
@@ -84,6 +85,9 @@ if [ -n "$2" ]; then
 	if [ "x${milterdkim_socket}" != "x" ];then
 	    _socket_prefix="-p"
 	fi
+	if [ "x${milterdkim_uid}" != "x" ];then
+	    _uid_prefix="-u"
+	fi
 	if [ "x${milterdkim_domain}" != "x" ];then
 	    milterdkim_domain="-d ${milterdkim_domain}"
 	fi
@@ -96,7 +100,7 @@ if [ -n "$2" ]; then
 	if [ "x${milterdkim_alg}" != "x" ];then
 	    milterdkim_alg="-S ${milterdkim_alg}"
 	fi
-	command_args="-l ${_socket_prefix} ${milterdkim_socket} -u ${milterdkim_uid} -P ${pidfile} ${milterdkim_cfgfile} ${milterdkim_domain} ${milterdkim_key} ${milterdkim_selector} ${milterdkim_alg}"
+	command_args="-l ${_socket_prefix} ${milterdkim_socket} ${_uid_prefix} ${milterdkim_uid} -P ${pidfile} ${milterdkim_cfgfile} ${milterdkim_domain} ${milterdkim_key} ${milterdkim_selector} ${milterdkim_alg}"
     else
 	echo "$0: extra argument ignored"
     fi
@@ -126,6 +130,9 @@ else
 	if [ "x${milterdkim_socket}" != "x" ];then
 	    _socket_prefix="-p"
 	fi
+	if [ "x${milterdkim_uid}" != "x" ];then
+	    _uid_prefix="-u"
+	fi
 	if [ "x${milterdkim_domain}" != "x" ];then
 	    milterdkim_domain="-d ${milterdkim_domain}"
 	fi
@@ -138,7 +145,7 @@ else
 	if [ "x${milterdkim_alg}" != "x" ];then
 	    milterdkim_alg="-S ${milterdkim_alg}"
 	fi
-	command_args="-l ${_socket_prefix} ${milterdkim_socket} -u ${milterdkim_uid} -P ${pidfile} ${milterdkim_cfgfile} ${milterdkim_domain} ${milterdkim_key} ${milterdkim_selector} ${milterdkim_alg}"
+	command_args="-l ${_socket_prefix} ${milterdkim_socket} ${_uid_prefix} ${milterdkim_uid} -P ${pidfile} ${milterdkim_cfgfile} ${milterdkim_domain} ${milterdkim_key} ${milterdkim_selector} ${milterdkim_alg}"
     fi
 fi
 
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86ocyeidc6.wl%umq>