SOURCES: proftpd-wtmp.patch - use proper path

baggins baggins at pld-linux.org
Mon Aug 20 14:53:49 CEST 2007


Author: baggins                      Date: Mon Aug 20 12:53:49 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use proper path

---- Files affected:
SOURCES:
   proftpd-wtmp.patch (1.24 -> 1.25) 

---- Diffs:

================================================================
Index: SOURCES/proftpd-wtmp.patch
diff -u SOURCES/proftpd-wtmp.patch:1.24 SOURCES/proftpd-wtmp.patch:1.25
--- SOURCES/proftpd-wtmp.patch:1.24	Mon Aug 20 14:48:53 2007
+++ SOURCES/proftpd-wtmp.patch	Mon Aug 20 14:53:44 2007
@@ -90,7 +90,7 @@
    AC_DEFINE(HAVE_SYSLOG_H)
 diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.wtmpx/src/log.c
 --- proftpd-1.3.1rc2/src/log.c	2006-12-11 20:53:43.000000000 +0100
-+++ proftpd-1.3.1rc2.wtmpx/src/log.c	2007-08-20 14:46:55.000000000 +0200
++++ proftpd-1.3.1rc2.wtmpx/src/log.c	2007-08-20 14:52:13.000000000 +0200
 @@ -59,119 +59,124 @@
    int res = 0;
    static int fd = -1;
@@ -105,9 +105,9 @@
 -#else
 -  struct utmpx utx;
 -#endif
--  static int fdx = -1;
 +#if defined(HAVE_UTMPX_H)
 +  char *wtmpx_file = NULL;
+   static int fdx = -1;
  
  #if !defined(WTMPX_FILE) && defined(_PATH_WTMPX)
  # define WTMPX_FILE _PATH_WTMPX
@@ -122,7 +122,7 @@
 -    pr_log_pri(PR_LOG_WARNING, "wtmpx %s: %s", WTMPX_FILE, strerror(errno));
 -    return -1;
 -  }
-+  if (wtmpx_file != NULL)
++  if (fdx >= 0 || wtmpx_file != NULL)
 +  {
 +#if defined(__sparcv9) && !defined(__NetBSD__)
 +    struct futmpx utx;
@@ -130,7 +130,6 @@
 +    struct utmpx utx;
 +    time_t t;
 +#endif
-+    static int fdx = -1;
  
 -  /* Unfortunately, utmp string fields are terminated by '\0' if they are
 -   * shorter than the size of the field, but if they are exactly the size of
@@ -140,8 +139,8 @@
 -   */
 -  if (fstat(fdx, &buf) == 0) {
 -    memset(&utx, 0, sizeof(utx));
-+    if (fdx < 0 && (fdx = open(WTMPX_FILE, O_WRONLY|O_APPEND, 0)) < 0) {
-+      pr_log_pri(PR_LOG_WARNING, "wtmpx %s: %s", WTMPX_FILE, strerror(errno));
++    if (fdx < 0 && (fdx = open(wtmpx_file, O_WRONLY|O_APPEND, 0)) < 0) {
++      pr_log_pri(PR_LOG_WARNING, "wtmpx %s: %s", wtmpx_file, strerror(errno));
 +      return -1;
 +    }
  
@@ -224,7 +223,7 @@
 +      if (write(fdx, (char *)&utx, sizeof(utx)) != sizeof(utx))
 +        ftruncate(fdx, buf.st_size);
 +    } else {
-+      pr_log_debug(DEBUG0, "%s fstat(): %s", WTMPX_FILE, strerror(errno));
++      pr_log_debug(DEBUG0, "%s fstat(): %s", wtmpx_file, strerror(errno));
 +      res = -1;
 +    }
 +
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/proftpd-wtmp.patch?r1=1.24&r2=1.25&f=u



More information about the pld-cvs-commit mailing list