]> git.pld-linux.org Git - packages/proftpd.git/commitdiff
- fixed 'gone - no logout' problem: http://bugs.proftpd.org/show_bug.cgi?id=3183
authorTomasz Pala <gotar@pld-linux.org>
Sun, 7 Jun 2009 19:16:31 +0000 (19:16 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    proftpd-logout.patch -> 1.1
    proftpd.spec -> 1.262

proftpd-logout.patch [new file with mode: 0644]
proftpd.spec

diff --git a/proftpd-logout.patch b/proftpd-logout.patch
new file mode 100644 (file)
index 0000000..8f7c126
--- /dev/null
@@ -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;
+ }
index aeeeaec58fa3a276bbaf253b6dd0397722014945..a79882e22eceacd525db7d83e0c930951135c032 100644 (file)
@@ -43,6 +43,7 @@ Patch1:               %{name}-noautopriv.patch
 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
@@ -441,6 +442,7 @@ dodaje hosty do pliku /etc/hosts.deny.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p0
 
 cp -f /usr/share/automake/config.sub .
 
This page took 0.147878 seconds and 4 git commands to generate.