]> git.pld-linux.org Git - packages/proftpd.git/commitdiff
- much cleaner and simpler
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 19 Aug 2007 19:36:15 +0000 (19:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    proftpd-wtmp.patch -> 1.20

proftpd-wtmp.patch

index 7841f7f6a373838a2384afc461bf58073a468ec9..7d0a62c56e71c4701f3691c768497336900fdb13 100644 (file)
@@ -1,6 +1,6 @@
---- proftpd-1.3.0.orig/src/log.c       2005-11-14 17:33:06.000000000 +0100
-+++ proftpd-1.3.0/src/log.c    2007-02-21 00:31:27.000000000 +0100
-@@ -54,31 +54,13 @@
+--- proftpd-1.3.0/src/log.c    2005-11-14 18:33:06.000000000 +0200
++++ proftpd-1.3.0.utmp/src/log.c       2006-04-29 14:17:55.023163252 +0300
+@@ -54,32 +54,12 @@
  
  int log_wtmp(char *line, const char *name, const char *host,
      pr_netaddr_t *ip) {
@@ -8,8 +8,7 @@
    struct utmp ut;
    int res = 0;
 -  static int fd = -1;
-+  static int washere = 0;
+-
 -#if ((defined(SVR4) || defined(__SVR4)) || \
 -    (defined(__NetBSD__) && defined(HAVE_UTMPX_H))) && \
 -    !(defined(LINUX) || defined(__hpux) || defined (_AIX))
 -  struct utmpx utx;
 -#endif
 -  static int fdx = -1;
--
--#if !defined(WTMPX_FILE) && defined(_PATH_WTMPX)
--# define WTMPX_FILE _PATH_WTMPX
--#endif
+ #if !defined(WTMPX_FILE) && defined(_PATH_WTMPX)
+ # define WTMPX_FILE _PATH_WTMPX
+ #endif
 -
 -  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 (!washere) {
-+    utmpname(_PATH_WTMP);
-+    washere = 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
 @@ -87,52 +69,7 @@
     * Insane if you ask me.  Unless there's massive uproar, I prefer to err on
     * the side of caution and always null-terminate our strings.
@@ -89,7 +86,7 @@
      memset(&ut, 0, sizeof(ut));
  #ifdef HAVE_UTMAXTYPE
  # ifdef LINUX
-@@ -169,15 +106,12 @@
+@@ -169,15 +106,8 @@
  #endif /* HAVE_UT_UT_HOST */
  
      time(&ut.ut_time);
 -  }
 -#endif /* SVR4 */
  
-+  setutent();
-+  while ((getutent())) ;
-+  pututline(&ut);
-+  if (!washere)
-+    endutent();
++  updwtmpx(WTMPX_FILE, &ut);
    return res;
  }
  
This page took 0.15728 seconds and 4 git commands to generate.