diff options
author | clsung <clsung@FreeBSD.org> | 2005-09-05 11:16:20 +0800 |
---|---|---|
committer | clsung <clsung@FreeBSD.org> | 2005-09-05 11:16:20 +0800 |
commit | 3100bd60fb47d5bcf1f3de97ef25eea3b82ceaf8 (patch) | |
tree | 0b7ccdf1e28bf29a93f48f4372bd851e73c550ac /security/clamsmtp | |
parent | a6a7702982d31935ec351a42491f7a96cd764257 (diff) | |
download | freebsd-ports-gnome-3100bd60fb47d5bcf1f3de97ef25eea3b82ceaf8.tar.gz freebsd-ports-gnome-3100bd60fb47d5bcf1f3de97ef25eea3b82ceaf8.tar.zst freebsd-ports-gnome-3100bd60fb47d5bcf1f3de97ef25eea3b82ceaf8.zip |
- 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>
Diffstat (limited to 'security/clamsmtp')
-rw-r--r-- | security/clamsmtp/Makefile | 2 | ||||
-rw-r--r-- | security/clamsmtp/files/clamsmtpd.sh.tmpl | 4 | ||||
-rw-r--r-- | security/clamsmtp/files/patch-smtppass.c | 57 |
3 files changed, 60 insertions, 3 deletions
diff --git a/security/clamsmtp/Makefile b/security/clamsmtp/Makefile index 1dc38fc2277b..154c92157d56 100644 --- a/security/clamsmtp/Makefile +++ b/security/clamsmtp/Makefile @@ -7,7 +7,7 @@ PORTNAME= clamsmtp PORTVERSION= 1.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= http://memberwebs.com/nielsen/software/clamsmtp/ diff --git a/security/clamsmtp/files/clamsmtpd.sh.tmpl b/security/clamsmtp/files/clamsmtpd.sh.tmpl index 7ff927455b64..2db6f5fa963e 100644 --- a/security/clamsmtp/files/clamsmtpd.sh.tmpl +++ b/security/clamsmtp/files/clamsmtpd.sh.tmpl @@ -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} diff --git a/security/clamsmtp/files/patch-smtppass.c b/security/clamsmtp/files/patch-smtppass.c new file mode 100644 index 000000000000..484d4f825a96 --- /dev/null +++ b/security/clamsmtp/files/patch-smtppass.c @@ -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 */ |