rpms/proftpd/devel proftpd-1.3.0-ctrls-restart.patch, NONE, 1.1 proftpd.spec, 1.16, 1.17

Matthias Saou (thias) fedora-extras-commits at redhat.com
Mon Jun 19 10:43:19 UTC 2006


Author: thias

Update of /cvs/extras/rpms/proftpd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27919/devel

Modified Files:
	proftpd.spec 
Added Files:
	proftpd-1.3.0-ctrls-restart.patch 
Log Message:
Include fix for bug #195884.


proftpd-1.3.0-ctrls-restart.patch:

--- NEW FILE proftpd-1.3.0-ctrls-restart.patch ---
Index: modules/mod_ctrls.c
===================================================================
RCS file: /cvsroot/proftp/proftpd/modules/mod_ctrls.c,v
retrieving revision 1.30
diff -u -r1.30 mod_ctrls.c
--- modules/mod_ctrls.c	11 Nov 2005 21:05:32 -0000	1.30
+++ modules/mod_ctrls.c	23 May 2006 17:31:51 -0000
@@ -3,7 +3,7 @@
  *          server, as well as several utility functions for other Controls
  *          modules
  *
- * Copyright (c) 2000-2005 TJ Saunders
+ * Copyright (c) 2000-2006 TJ Saunders
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@
 #include "privs.h"
 #include "mod_ctrls.h"
 
-#define MOD_CTRLS_VERSION "mod_ctrls/0.9.3"
+#define MOD_CTRLS_VERSION "mod_ctrls/0.9.4"
 
 /* Master daemon in standalone mode? (from src/main.c) */
 extern unsigned char is_master;
@@ -518,7 +518,7 @@
   } else if (res == PR_LOG_WRITABLE_DIR) {
     pr_log_pri(PR_LOG_NOTICE, MOD_CTRLS_VERSION
       ": unable to open ControlsLog '%s': "
-      "containing directory is world writeable", ctrls_logname);
+      "containing directory is world writable", ctrls_logname);
 
   } else if (res == PR_LOG_SYMLINK) {
     pr_log_pri(PR_LOG_NOTICE, MOD_CTRLS_VERSION
@@ -1476,7 +1476,7 @@
 
     if (res == -2)
       CONF_ERROR(cmd, pstrcat(cmd->tmp_pool,
-        "unable to log to a world-writeable directory", NULL));
+        "unable to log to a world-writable directory", NULL));
   }
 
   return HANDLED(cmd);
@@ -1506,10 +1506,12 @@
     CONF_ERROR(cmd, "must be an absolute path");
 
   /* Close the socket. */
-  pr_log_debug(DEBUG3, MOD_CTRLS_VERSION ": closing ctrls socket '%s'",
-    ctrls_sock_file);
-  close(ctrls_sockfd);
-  ctrls_sockfd = -1;
+  if (ctrls_sockfd >= 0) {
+    pr_log_debug(DEBUG3, MOD_CTRLS_VERSION ": closing ctrls socket '%s' (%d)",
+      ctrls_sock_file, ctrls_sockfd);
+    close(ctrls_sockfd);
+    ctrls_sockfd = -1;
+  }
 
   /* Change the path. */
   if (strcmp(cmd->argv[1], ctrls_sock_file) != 0)
@@ -1608,9 +1610,28 @@
   PRIVS_ROOT
   ctrls_sockfd = ctrls_listen(ctrls_sock_file);
   PRIVS_RELINQUISH
-  if (ctrls_sockfd < 0)
+  if (ctrls_sockfd < 0) {
     pr_log_pri(PR_LOG_NOTICE, "notice: unable to listen to local socket: %s",
       strerror(errno));
+
+  } else {
+    /* Ensure that the listen socket used is not one of the major three
+     * (stdin, stdout, or stderr).
+     */
+    if (ctrls_sockfd < 3) {
+      if (dup2(ctrls_sockfd, 3) < 0) {
+        pr_log_pri(PR_LOG_NOTICE, MOD_CTRLS_VERSION
+          ": error duplicating listen socket: %s", strerror(errno));
+        (void) close(ctrls_sockfd);
+        ctrls_sockfd = -1;
+
+      } else {
+        (void) close(ctrls_sockfd);
+        ctrls_sockfd = 3;
+      }
+    }
+  }
+
 }
 
 static void ctrls_restart_ev(const void *event_data, void *user_data) {
@@ -1633,10 +1654,11 @@
   cl_list = NULL;
   cl_listlen = 0;
 
-  pr_log_debug(DEBUG3, MOD_CTRLS_VERSION ": closing ctrls socket '%s'",
-    ctrls_sock_file);
+  pr_log_debug(DEBUG3, MOD_CTRLS_VERSION ": closing ctrls socket '%s' (%d)",
+    ctrls_sock_file, ctrls_sockfd);
   close(ctrls_sockfd);
   ctrls_sockfd = -1;
+
   ctrls_closelog();
 
   /* Clear the existing pool */


Index: proftpd.spec
===================================================================
RCS file: /cvs/extras/rpms/proftpd/devel/proftpd.spec,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- proftpd.spec	10 May 2006 11:29:02 -0000	1.16
+++ proftpd.spec	19 Jun 2006 10:43:18 -0000	1.17
@@ -1,7 +1,7 @@
 Summary: Flexible, stable and highly-configurable FTP server
 Name: proftpd
 Version: 1.3.0
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPL
 Group: System Environment/Daemons
 URL: http://www.proftpd.org/
@@ -13,6 +13,7 @@
 Source5: welcome.msg
 Source6: proftpd.pam
 Patch0: proftpd-1.3.0-rpath.patch
+Patch1: proftpd-1.3.0-ctrls-restart.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Requires: pam >= 0.59
 Requires(post): /sbin/chkconfig
@@ -64,6 +65,7 @@
 %prep
 %setup
 %patch0 -p1 -b .rpath
+%patch1 -p0 -b .ctrls-restart
 
 
 %build
@@ -179,6 +181,9 @@
 
 
 %changelog
+* Mon Jun 19 2006 Matthias Saou <http://freshrpms.net/> 1.3.0-4
+- Include ctrls restart patch, see #195884 (patch from proftpd.org #2792).
+
 * Wed May 10 2006 Matthias Saou <http://freshrpms.net/> 1.3.0-3
 - Add commented section about DSO loading to the default proftpd.conf.
 - Update TLS cert paths in the default proftpd.conf to /etc/pki/tls.




More information about the fedora-extras-commits mailing list