SOURCES: proftpd-wtmp.patch - 1.3.0 from DEVEL

glen glen at pld-linux.org
Sat Apr 29 16:21:08 CEST 2006


Author: glen                         Date: Sat Apr 29 14:21:08 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- 1.3.0 from DEVEL

---- Files affected:
SOURCES:
   proftpd-wtmp.patch (1.15 -> 1.16) 

---- Diffs:

================================================================
Index: SOURCES/proftpd-wtmp.patch
diff -u SOURCES/proftpd-wtmp.patch:1.15 SOURCES/proftpd-wtmp.patch:1.16
--- SOURCES/proftpd-wtmp.patch:1.15	Wed Sep  1 08:43:22 2004
+++ SOURCES/proftpd-wtmp.patch	Sat Apr 29 16:21:03 2006
@@ -1,6 +1,6 @@
---- proftpd-1.2.10rc3/src/log.c.orig	2004-04-20 04:05:41.000000000 +0200
-+++ proftpd-1.2.10rc3/src/log.c	2004-09-01 08:26:12.959741640 +0200
-@@ -54,27 +54,16 @@
+--- 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,31 +54,13 @@
  
  int log_wtmp(char *line, const char *name, const char *host,
      pr_netaddr_t *ip) {
@@ -8,8 +8,10 @@
    struct utmp ut;
    int res = 0;
 -  static int fd = -1;
++  static int washere = 0;
  
--#if (defined(SVR4) || defined(__SVR4)) && \
+-#if ((defined(SVR4) || defined(__SVR4)) || \
+-    (defined(__NetBSD__) && defined(HAVE_UTMPX_H))) && \
 -    !(defined(LINUX) || defined(__hpux) || defined (_AIX))
 -  /* This "auxilliary" utmp doesn't exist under linux. */
 -#ifdef __sparcv9
@@ -20,22 +22,21 @@
 -#endif
 -  static int fdx = -1;
 -
+-#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;
--  }
-+  static int washere = 0;
-+  
 +  if (!washere) {
 +    utmpname(_PATH_WTMP);
 +    washere = 1;
-+  } else
-+    washere = 0;
+   }
  
    /* 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
-@@ -82,46 +71,6 @@
+@@ -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.
     */
@@ -46,14 +47,20 @@
 -    sstrncpy(utx.ut_id, "ftp", sizeof(utx.ut_user));
 -    sstrncpy(utx.ut_line, line, sizeof(utx.ut_line));
 -    sstrncpy(utx.ut_host, host, sizeof(utx.ut_host));
--    utx.ut_syslen = strlen(utx.ut_host)+1;
 -    utx.ut_pid = getpid();
--#ifdef __sparcv9
+-#if defined(__NetBSD__) && defined(HAVE_UTMPX_H)
+-    memcpy(&utx.ut_ss, pr_netaddr_get_inaddr(ip), sizeof(utx.ut_ss));
+-    gettimeofday(&utx.ut_tv, NULL);
+-#else /* SVR4 */
+-    utx.ut_syslen = strlen(utx.ut_host)+1;
+-#  ifdef __sparcv9
 -    time(&t);
 -    utx.ut_tv.tv_sec = (time32_t)t;
--#else
+-#  else
 -    time(&utx.ut_tv.tv_sec);
--#endif
+-#  endif
+-#endif /* SVR4 */
+-
 -    if (*name)
 -      utx.ut_type = USER_PROCESS;
 -    else
@@ -77,12 +84,12 @@
 -    pr_log_pri(PR_LOG_WARNING, "wtmp %s: %s", WTMP_FILE, strerror(errno));
 -    return -1;
 -  }
--
+ 
 -  if (fstat(fd, &buf) == 0) {
      memset(&ut, 0, sizeof(ut));
  #ifdef HAVE_UTMAXTYPE
  # ifdef LINUX
-@@ -158,15 +107,12 @@
+@@ -169,15 +106,12 @@
  #endif /* HAVE_UT_UT_HOST */
  
      time(&ut.ut_time);
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/proftpd-wtmp.patch?r1=1.15&r2=1.16&f=u



More information about the pld-cvs-commit mailing list