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

proftpd-wtmp.patch

index 378186671ed0727d2569114e0b8f794679256740..546ab5235ff8456a1d32dc1ba0353b2852b35005 100644 (file)
@@ -90,7 +90,7 @@ diff -ur proftpd-1.3.1rc2/configure.in proftpd-1.3.1rc2.wtmpx/configure.in
    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
    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;
 @@ -59,119 +59,124 @@
    int res = 0;
    static int fd = -1;
@@ -105,9 +105,9 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.wtmpx/src/log.c
 -#else
 -  struct utmpx utx;
 -#endif
 -#else
 -  struct utmpx utx;
 -#endif
--  static int fdx = -1;
 +#if defined(HAVE_UTMPX_H)
 +  char *wtmpx_file = NULL;
 +#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
  
  #if !defined(WTMPX_FILE) && defined(_PATH_WTMPX)
  # define WTMPX_FILE _PATH_WTMPX
@@ -122,7 +122,7 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.wtmpx/src/log.c
 -    pr_log_pri(PR_LOG_WARNING, "wtmpx %s: %s", WTMPX_FILE, strerror(errno));
 -    return -1;
 -  }
 -    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;
 +  {
 +#if defined(__sparcv9) && !defined(__NetBSD__)
 +    struct futmpx utx;
@@ -130,7 +130,6 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.wtmpx/src/log.c
 +    struct utmpx utx;
 +    time_t t;
 +#endif
 +    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
  
 -  /* 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 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.wtmpx/src/log.c
 -   */
 -  if (fstat(fdx, &buf) == 0) {
 -    memset(&utx, 0, sizeof(utx));
 -   */
 -  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;
 +    }
  
 +      return -1;
 +    }
  
@@ -224,7 +223,7 @@ diff -ur proftpd-1.3.1rc2/src/log.c proftpd-1.3.1rc2.wtmpx/src/log.c
 +      if (write(fdx, (char *)&utx, sizeof(utx)) != sizeof(utx))
 +        ftruncate(fdx, buf.st_size);
 +    } else {
 +      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;
 +    }
 +
 +      res = -1;
 +    }
 +
This page took 0.214654 seconds and 4 git commands to generate.