]> git.pld-linux.org Git - packages/proftpd.git/commitdiff
- find the proper wtmpx file
authorJan Rękorajski <baggins@pld-linux.org>
Mon, 20 Aug 2007 12:48:53 +0000 (12:48 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    proftpd-wtmp.patch -> 1.24

proftpd-wtmp.patch

index f654cb2f7939d01da8f082cd773a37cfb1df054d..378186671ed0727d2569114e0b8f794679256740 100644 (file)
@@ -1,5 +1,6 @@
---- proftpd-1.3.1rc2.utmpx/acconfig.h~ 2002-12-15 19:05:09.000000000 +0100
-+++ proftpd-1.3.1rc2.utmpx/acconfig.h  2007-08-20 14:13:20.000000000 +0200
+diff -ur proftpd-1.3.1rc2/acconfig.h proftpd-1.3.1rc2.wtmpx/acconfig.h
+--- proftpd-1.3.1rc2/acconfig.h        2002-12-15 19:05:09.000000000 +0100
++++ proftpd-1.3.1rc2.wtmpx/acconfig.h  2007-08-20 14:44:18.000000000 +0200
 @@ -70,7 +70,7 @@
  #undef HAVE_UT_UT_HOST
  
@@ -9,8 +10,9 @@
  
  #define PF_ARGV_NONE          0
  #define PF_ARGV_NEW           1
---- proftpd-1.3.1rc2.utmpx/config.h.in~        2007-08-20 13:25:55.000000000 +0200
-+++ proftpd-1.3.1rc2.utmpx/config.h.in 2007-08-20 14:14:03.000000000 +0200
+diff -ur proftpd-1.3.1rc2/config.h.in proftpd-1.3.1rc2.wtmpx/config.h.in
+--- proftpd-1.3.1rc2/config.h.in       2007-08-20 14:47:10.000000000 +0200
++++ proftpd-1.3.1rc2.wtmpx/config.h.in 2007-08-20 14:44:18.000000000 +0200
 @@ -119,7 +119,7 @@
  #undef HAVE_UT_UT_HOST
  
@@ -20,9 +22,9 @@
  
  #define PF_ARGV_NONE          0
  #define PF_ARGV_NEW           1
-diff -ur proftpd-1.3.1rc2/configure.in proftpd-1.3.1rc2.utmpx/configure.in
---- proftpd-1.3.1rc2/configure.in      2007-08-20 14:07:40.000000000 +0200
-+++ proftpd-1.3.1rc2.utmpx/configure.in        2007-08-20 14:07:28.000000000 +0200
+diff -ur proftpd-1.3.1rc2/configure.in proftpd-1.3.1rc2.wtmpx/configure.in
+--- proftpd-1.3.1rc2/configure.in      2007-08-20 14:47:10.000000000 +0200
++++ proftpd-1.3.1rc2.wtmpx/configure.in        2007-08-20 14:44:18.000000000 +0200
 @@ -1056,7 +1056,7 @@
  AC_CHECK_HEADERS(sys/stat.h errno.h sys/socket.h sys/termios.h sys/termio.h)
  AC_CHECK_HEADERS(sys/statvfs.h sys/un.h sys/vfs.h sys/select.h)
@@ -86,10 +88,10 @@ diff -ur proftpd-1.3.1rc2/configure.in proftpd-1.3.1rc2.utmpx/configure.in
  dnl See if various LOG_ macros are defined
  if test "$have_syslog_h" = "yes"; then
    AC_DEFINE(HAVE_SYSLOG_H)
-diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.utmpx/src/log.c
+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.utmpx/src/log.c   2007-08-20 14:07:30.000000000 +0200
-@@ -59,119 +59,116 @@
++++ proftpd-1.3.1rc2.wtmpx/src/log.c   2007-08-20 14:46:55.000000000 +0200
+@@ -59,119 +59,124 @@
    int res = 0;
    static int fd = -1;
  
@@ -105,11 +107,23 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.utmpx/src/log.c
 -#endif
 -  static int fdx = -1;
 +#if defined(HAVE_UTMPX_H)
++  char *wtmpx_file = NULL;
  
  #if !defined(WTMPX_FILE) && defined(_PATH_WTMPX)
  # define WTMPX_FILE _PATH_WTMPX
  #endif
-+  if (access(WTMPX_FILE, F_OK) == 0) {
++  if (access(WTMPX_FILE, F_OK) == 0)
++    wtmpx_file = strdup(WTMPX_FILE);
++  else if (access(WTMPX_FILE"x", F_OK) == 0)
++    wtmpx_file = strdup(WTMPX_FILE"x");
+-  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;
+-  }
++  if (wtmpx_file != NULL)
++  {
 +#if defined(__sparcv9) && !defined(__NetBSD__)
 +    struct futmpx utx;
 +#else
@@ -118,12 +132,6 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.utmpx/src/log.c
 +#endif
 +    static int fdx = -1;
  
--  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;
--  }
--
 -  /* 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
 -   * the field they don't have to be terminated at all.  Frankly, this sucks.
@@ -220,6 +228,7 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.utmpx/src/log.c
 +      res = -1;
 +    }
 +
++    free(wtmpx_file);
 +    return res;
 +  }
 +#else /* HAVE_UTMPX_H */
@@ -291,3 +300,4 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.utmpx/src/log.c
    } else {
      pr_log_debug(DEBUG0, "%s fstat(): %s",WTMP_FILE,strerror(errno));
      res = -1;
+Only in proftpd-1.3.1rc2.wtmpx/src: log.c~
This page took 0.168822 seconds and 4 git commands to generate.