From ba9b13ed3df358717721e0ecdd6665274e4bb361 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Mon, 20 Aug 2007 12:53:44 +0000 Subject: [PATCH] - use proper path Changed files: proftpd-wtmp.patch -> 1.25 --- proftpd-wtmp.patch | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/proftpd-wtmp.patch b/proftpd-wtmp.patch index 3781866..546ab52 100644 --- a/proftpd-wtmp.patch +++ b/proftpd-wtmp.patch @@ -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 -+++ 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; @@ -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 -- static int fdx = -1; +#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 @@ -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; - } -+ if (wtmpx_file != NULL) ++ if (fdx >= 0 || wtmpx_file != NULL) + { +#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 -+ 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 @@ -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 (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; + } @@ -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 { -+ pr_log_debug(DEBUG0, "%s fstat(): %s", WTMPX_FILE, strerror(errno)); ++ pr_log_debug(DEBUG0, "%s fstat(): %s", wtmpx_file, strerror(errno)); + res = -1; + } + -- 2.43.0