SOURCES: proftpd-wtmp.patch - find the proper wtmpx file
baggins
baggins at pld-linux.org
Mon Aug 20 14:48:58 CEST 2007
Author: baggins Date: Mon Aug 20 12:48:58 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- find the proper wtmpx file
---- Files affected:
SOURCES:
proftpd-wtmp.patch (1.23 -> 1.24)
---- Diffs:
================================================================
Index: SOURCES/proftpd-wtmp.patch
diff -u SOURCES/proftpd-wtmp.patch:1.23 SOURCES/proftpd-wtmp.patch:1.24
--- SOURCES/proftpd-wtmp.patch:1.23 Mon Aug 20 14:15:46 2007
+++ SOURCES/proftpd-wtmp.patch Mon Aug 20 14:48:53 2007
@@ -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 @@
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 @@
-#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 @@
+#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 @@
+ res = -1;
+ }
+
++ free(wtmpx_file);
+ return res;
+ }
+#else /* HAVE_UTMPX_H */
@@ -291,3 +300,4 @@
} else {
pr_log_debug(DEBUG0, "%s fstat(): %s",WTMP_FILE,strerror(errno));
res = -1;
+Only in proftpd-1.3.1rc2.wtmpx/src: log.c~
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/proftpd-wtmp.patch?r1=1.23&r2=1.24&f=u
More information about the pld-cvs-commit
mailing list