packages: proftpd/proftpd.spec, proftpd/proftpd-logout.patch (NEW) - fixed ...
gotar
gotar at pld-linux.org
Sun Jun 7 21:16:37 CEST 2009
Author: gotar Date: Sun Jun 7 19:16:37 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- fixed 'gone - no logout' problem: http://bugs.proftpd.org/show_bug.cgi?id=3183
---- Files affected:
packages/proftpd:
proftpd.spec (1.261 -> 1.262) , proftpd-logout.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/proftpd/proftpd.spec
diff -u packages/proftpd/proftpd.spec:1.261 packages/proftpd/proftpd.spec:1.262
--- packages/proftpd/proftpd.spec:1.261 Wed Apr 8 23:49:37 2009
+++ packages/proftpd/proftpd.spec Sun Jun 7 21:16:31 2009
@@ -44,6 +44,7 @@
Patch2: %{name}-wtmp.patch
Patch3: %{name}-pool.patch
Patch4: %{name}-nostrip.patch
+Patch5: %{name}-logout.patch
URL: http://www.proftpd.org/
BuildRequires: autoconf
BuildRequires: automake
@@ -442,6 +443,7 @@
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p0
cp -f /usr/share/automake/config.sub .
@@ -761,6 +763,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.262 2009/06/07 19:16:31 gotar
+- fixed 'gone - no logout' problem: http://bugs.proftpd.org/show_bug.cgi?id=3183
+
Revision 1.261 2009/04/08 21:49:37 baggins
- rel 3
- no parallel build
================================================================
Index: packages/proftpd/proftpd-logout.patch
diff -u /dev/null packages/proftpd/proftpd-logout.patch:1.1
--- /dev/null Sun Jun 7 21:16:37 2009
+++ packages/proftpd/proftpd-logout.patch Sun Jun 7 21:16:31 2009
@@ -0,0 +1,101 @@
+Index: modules/mod_auth.c
+===================================================================
+RCS file: /cvsroot/proftp/proftpd/modules/mod_auth.c,v
+retrieving revision 1.252
+diff -u -r1.252 mod_auth.c
+--- modules/mod_auth.c 11 Feb 2009 06:56:43 -0000 1.252
++++ modules/mod_auth.c 12 Feb 2009 18:48:16 -0000
+@@ -1074,11 +1074,13 @@
+ * through with the login process. Oh well.
+ */
+
++ memset(sess_ttyname, '\0', sizeof(sess_ttyname));
+ #if (defined(BSD) && (BSD >= 199103))
+ snprintf(sess_ttyname, sizeof(sess_ttyname), "ftp%ld", (long) getpid());
+ #else
+ snprintf(sess_ttyname, sizeof(sess_ttyname), "ftpd%d", (int) getpid());
+ #endif
++ sess_ttyname[sizeof(sess_ttyname)-1] = '\0';
+
+ /* Perform wtmp logging only if not turned off in <Anonymous>
+ * or the current server
+Index: src/main.c
+===================================================================
+RCS file: /cvsroot/proftp/proftpd/src/main.c,v
+retrieving revision 1.361
+diff -u -r1.361 main.c
+--- src/main.c 11 Feb 2009 05:57:12 -0000 1.361
++++ src/main.c 12 Feb 2009 18:48:16 -0000
+@@ -92,8 +92,6 @@
+
+ static unsigned char have_dead_child = FALSE;
+
+-static char sbuf[PR_TUNABLE_BUFFER_SIZE] = {'\0'};
+-
+ #define PR_DEFAULT_CMD_BUFSZ 512
+
+ /* From mod_auth_unix.c */
+@@ -108,7 +106,16 @@
+ static int syntax_check = 0;
+
+ static const char *protocol_name = "FTP";
++
++/* This protocol_name_lc variable is used only by WtmpLog logging. Newer
++ * BSD variants require a name of "ftp" while other, non-BSD variants
++ * prefer "ftpd".
++ */
++#if (defined(BSD) && (BSD >= 199103))
+ static const char *protocol_name_lc = "ftp";
++#else
++static const char *protocol_name_lc = "ftpd";
++#endif
+
+ /* Command handling */
+ static void cmd_loop(server_rec *, conn_t *);
+@@ -185,6 +192,7 @@
+ }
+
+ static void end_login_noexit(void) {
++ char wtmp_buf[PR_TUNABLE_BUFFER_SIZE];
+
+ /* Clear the scoreboard entry. */
+ if (ServerType == SERVER_STANDALONE) {
+@@ -206,20 +214,25 @@
+ strerror(errno));
+ }
+
++ if (session.wtmp_log) {
++ memset(wtmp_buf, '\0', sizeof(wtmp_buf));
++ }
++
+ /* If session.user is set, we have a valid login */
+ if (session.user) {
+ #if (defined(BSD) && (BSD >= 199103))
+- snprintf(sbuf, sizeof(sbuf), "%s%ld", protocol_name_lc,
++ snprintf(wtmp_buf, sizeof(wtmp_buf), "%s%ld", protocol_name_lc,
+ (long) (session.pid ? session.pid : getpid()));
+ #else
+- snprintf(sbuf, sizeof(sbuf), "%s%d", protocol_name_lc,
++ snprintf(wtmp_buf, sizeof(wtmp_buf), "%s%d", protocol_name_lc,
+ (int) (session.pid ? session.pid : getpid()));
+ #endif
+- sbuf[sizeof(sbuf) - 1] = '\0';
++ wtmp_buf[sizeof(wtmp_buf) - 1] = '\0';
+
+- if (session.wtmp_log)
+- log_wtmp(sbuf, "", pr_netaddr_get_sess_remote_name(),
++ if (session.wtmp_log) {
++ log_wtmp(wtmp_buf, "", pr_netaddr_get_sess_remote_name(),
+ pr_netaddr_get_sess_remote_addr());
++ }
+ }
+
+ /* These are necessary in order that cleanups associated with these pools
+@@ -573,7 +586,6 @@
+ }
+
+ protocol_name_lc = lc;
+-
+ return 0;
+ }
+
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/proftpd/proftpd.spec?r1=1.261&r2=1.262&f=u
More information about the pld-cvs-commit
mailing list