X-Git-Url: https://git.tld-linux.org/?p=packages%2Fproftpd.git;a=blobdiff_plain;f=proftpd-wtmp.patch;fp=proftpd-wtmp.patch;h=fb84cbd7496c6efc72c47335826d6474e88fce35;hp=0000000000000000000000000000000000000000;hb=70f48441b976cbaa5c7a80c2e4b4f635949e294f;hpb=0d3050bbdf7025b50604090f02a086a44f3865e8 diff --git a/proftpd-wtmp.patch b/proftpd-wtmp.patch new file mode 100644 index 0000000..fb84cbd --- /dev/null +++ b/proftpd-wtmp.patch @@ -0,0 +1,39 @@ +diff -ruNp proftpd-1.3.5.orig/src/wtmp.c proftpd-1.3.5/src/wtmp.c +--- proftpd-1.3.5.orig/src/wtmp.c 2013-12-09 20:16:15.000000000 +0100 ++++ proftpd-1.3.5/src/wtmp.c 2015-04-03 11:47:21.710554599 +0200 +@@ -136,11 +136,33 @@ int log_wtmp(const char *line, const cha + struct utmp ut; + static int fd = -1; + ++#if defined(HAVE_UTMPX_H) ++#if !defined(WTMPX_FILE) && defined(_PATH_WTMPX) ++# define WTMPX_FILE _PATH_WTMPX ++#endif ++ static char *wtmp_file = NULL; ++ if (wtmp_file == NULL) { ++ if (access(WTMPX_FILE"x", F_OK) == 0) ++ wtmp_file = WTMPX_FILE"x"; ++ else if (access(WTMPX_FILE, F_OK) == 0) ++ wtmp_file = WTMPX_FILE; ++ else if (access(WTMP_FILE"x", F_OK) == 0) ++ wtmp_file = WTMP_FILE"x"; ++ else if (access(WTMP_FILE, F_OK) == 0) ++ wtmp_file = WTMP_FILE; ++ else { ++ pr_log_pri(PR_LOG_WARNING, "cannot find "WTMPX_FILE); ++ return -1; ++ } ++ } ++#else ++ static char *wtmp_file = WTMP_FILE; ++#endif + if (fd < 0 && +- (fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) < 0) { ++ (fd = open(wtmp_file, O_WRONLY|O_APPEND, 0)) < 0) { + int xerrno = errno; + +- pr_log_pri(PR_LOG_WARNING, "failed to open wtmp %s: %s", WTMP_FILE, ++ pr_log_pri(PR_LOG_WARNING, "failed to open wtmp %s: %s", wtmp_file, + strerror(xerrno)); + + errno = xerrno;