1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

- clamsmtp 1.5 works only in debug mode.

Included patch fix this bug by moving socket creation after daemonizing as
suggested in mailing list clamsmtp-users@lists.sourceforge.net
http://sourceforge.net/mailarchive/forum.php?thread_id=8060741&forum_id=42732
- bump PORTREVISION

PR:		ports/85706
Submitted by:	Alex L. Demidov <alexd AT vinf dot ru>
This commit is contained in:
Cheng-Lung Sung 2005-09-05 03:16:20 +00:00
parent 6b5bfe2237
commit 97cb38e987
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=141968
3 changed files with 60 additions and 3 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= clamsmtp
PORTVERSION= 1.5
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://memberwebs.com/nielsen/software/clamsmtp/

View File

@ -24,9 +24,9 @@ load_rc_config ${name}
clamsmtpd_enable=${clamsmtpd_enable-"NO"}
clamsmtpd_conf=${clamsmtpd_conf-"%%PREFIX%%/etc/clamsmtpd.conf"}
clamsmtpd_pid=${clamsmtpd_pid-"%%CLAMAV_PID_DIR%%/clamsmtpd.pid"}
clamsmtpd_debug=${clamsmtpd_debug-"4"}
clamsmtpd_debug=${clamsmtpd_debug-"0"}
command_args="-f ${clamsmtpd_conf} -p ${clamsmtpd_pid} -d ${clamsmtpd_debug}"
command_args="-f ${clamsmtpd_conf} -p ${clamsmtpd_pid}"
pidfile=${clamsmtpd_pid}

View File

@ -0,0 +1,57 @@
diff -ur ../clamsmtp-1.5-orig/common/smtppass.c common/smtppass.c
--- common/smtppass.c Tue Aug 2 01:23:05 2005
+++ common/smtppass.c Sun Sep 4 11:52:13 2005
@@ -275,6 +275,26 @@
sp_messagex(NULL, LOG_DEBUG, "starting up (%s)...", VERSION);
+ /* Drop privileges before daemonizing */
+ drop_privileges();
+
+ /* When set to this we daemonize */
+ if(g_state.debug_level == -1)
+ {
+ /* Fork a daemon nicely here */
+ if(daemon(0, 0) == -1)
+ {
+ sp_message(NULL, LOG_ERR, "couldn't run as daemon");
+ exit(1);
+ }
+
+ sp_messagex(NULL, LOG_DEBUG, "running as a daemon");
+ g_state.daemonized = 1;
+
+ /* Open the system log */
+ openlog(g_state.name, 0, LOG_MAIL);
+ }
+
/* Create the socket */
sock = socket(SANY_TYPE(g_state.listenaddr), SOCK_STREAM, 0);
if(sock < 0)
@@ -297,26 +317,6 @@
exit(1);
}
- /* Drop privileges before daemonizing */
- drop_privileges();
-
- /* When set to this we daemonize */
- if(g_state.debug_level == -1)
- {
- /* Fork a daemon nicely here */
- if(daemon(0, 0) == -1)
- {
- sp_message(NULL, LOG_ERR, "couldn't run as daemon");
- exit(1);
- }
-
- sp_messagex(NULL, LOG_DEBUG, "running as a daemon");
- g_state.daemonized = 1;
-
- /* Open the system log */
- openlog(g_state.name, 0, LOG_MAIL);
- }
-
sp_messagex(NULL, LOG_DEBUG, "created socket: %s", g_state.listenname);
/* Handle some signals */