View | Details | Raw Unified | Return to bug 103346
Collapse All | Expand All

(-)dkimproxy/Makefile (+1 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	dkimproxy
8
PORTNAME=	dkimproxy
9
PORTVERSION=	0.13
9
PORTVERSION=	0.13
10
PORTREVISION=	2
10
CATEGORIES=	mail
11
CATEGORIES=	mail
11
MASTER_SITES=	http://jason.long.name/dkimproxy/
12
MASTER_SITES=	http://jason.long.name/dkimproxy/
12
13
(-)dkimproxy/files/dkimproxy_in.in (-6 / +17 lines)
Lines 42-60 Link Here
42
	logger -t ${name} "Starting ${name}"
42
	logger -t ${name} "Starting ${name}"
43
	touch ${dkimproxy_in_pidfile}
43
	touch ${dkimproxy_in_pidfile}
44
	chown ${dkimproxy_in_user} ${dkimproxy_in_pidfile}
44
	chown ${dkimproxy_in_user} ${dkimproxy_in_pidfile}
45
	logfile=`mktemp /tmp/${name}.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
45
	tmpfile=`mktemp /tmp/${name}.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
46
	su -m ${dkimproxy_in_user} -c "daemon -c -p ${dkimproxy_in_pidfile} \
46
	su -m ${dkimproxy_in_user} -c "daemon -c -p ${dkimproxy_in_pidfile} \
47
		%%PREFIX%%/bin/dkimproxy.in ${dkimproxy_in_flags}" \
47
		%%PREFIX%%/bin/dkimproxy.in ${dkimproxy_in_flags}" \
48
		> /dev/null 2> ${logfile}
48
		> /dev/null 2> ${tmpfile}
49
	sleep 1 # XXX: wait until dkimproxy start.
49
	# wait until dkimproxy start.
50
	logger -t ${name} "`cat ${logfile}`"
50
	while true
51
	err=`grep Error ${logfile}`
51
	do
52
		filesize=`ls -l ${tmpfile}|awk '{print $5}'`
53
		if [ ${filesize} -gt 0 ]; then
54
			break
55
		fi
56
	done
57
58
	logger -t ${name} "`cat ${tmpfile}`"
59
	err=`grep Error ${tmpfile}`
52
	if [ "${err}" ]; then
60
	if [ "${err}" ]; then
53
		echo "Failed to start ${name}."
61
		echo "Failed to start ${name}."
54
		echo "${err}"
62
		echo "${err}"
55
		rm -f ${dkimproxy_in_pidfile}
63
		rm -f ${dkimproxy_in_pidfile}
64
	else
65
		# To prevent DoS attack by dkimproxy_in_user.
66
		chown root:wheel ${dkimproxy_in_pidfile}
56
	fi
67
	fi
57
	rm -f ${logfile}
68
	rm -f ${tmpfile}
58
}
69
}
59
70
60
dkimproxy_in_stop()
71
dkimproxy_in_stop()
(-)dkimproxy/files/dkimproxy_out.in (-6 / +17 lines)
Lines 47-65 Link Here
47
	logger -t ${name} "Starting ${name}"
47
	logger -t ${name} "Starting ${name}"
48
	touch ${dkimproxy_out_pidfile}
48
	touch ${dkimproxy_out_pidfile}
49
	chown ${dkimproxy_out_user} ${dkimproxy_out_pidfile}
49
	chown ${dkimproxy_out_user} ${dkimproxy_out_pidfile}
50
	logfile=`mktemp /tmp/${name}.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
50
	tmpfile=`mktemp /tmp/${name}.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`
51
	su -m ${dkimproxy_out_user} -c "daemon -c -p ${dkimproxy_out_pidfile} \
51
	su -m ${dkimproxy_out_user} -c "daemon -c -p ${dkimproxy_out_pidfile} \
52
		%%PREFIX%%/bin/dkimproxy.out ${dkimproxy_out_flags}" \
52
		%%PREFIX%%/bin/dkimproxy.out ${dkimproxy_out_flags}" \
53
		> /dev/null 2> ${logfile}
53
		> /dev/null 2> ${tmpfile}
54
	sleep 1 # XXX: wait until dkimproxy start.
54
	# wait until dkimproxy start.
55
	logger -t ${name} "`cat ${logfile}`"
55
	while true
56
	err=`grep Error ${logfile}`
56
	do
57
		filesize=`ls -l ${tmpfile}|awk '{print $5}'`
58
		if [ ${filesize} -gt 0 ]; then
59
			break
60
		fi
61
	done
62
63
	logger -t ${name} "`cat ${tmpfile}`"
64
	err=`grep Error ${tmpfile}`
57
	if [ "${err}" ]; then
65
	if [ "${err}" ]; then
58
		echo "Failed to start ${name}."
66
		echo "Failed to start ${name}."
59
		echo "${err}"
67
		echo "${err}"
60
		rm -f ${dkimproxy_out_pidfile}
68
		rm -f ${dkimproxy_out_pidfile}
69
	else
70
		# To prevent DoS attack by dkimproxy_out_user.
71
		chown root:wheel ${dkimproxy_out_pidfile}
61
	fi
72
	fi
62
	rm -f ${logfile}
73
	rm -f ${tmpfile}
63
}
74
}
64
75
65
dkimproxy_out_stop()
76
dkimproxy_out_stop()

Return to bug 103346