aboutsummaryrefslogtreecommitdiff
path: root/ftp
diff options
context:
space:
mode:
authorMunechika SUMIKAWA <sumikawa@FreeBSD.org>2010-01-25 09:09:16 +0000
committerMunechika SUMIKAWA <sumikawa@FreeBSD.org>2010-01-25 09:09:16 +0000
commit772ac3852f89750a9c215b7c2972d7c122b53693 (patch)
treea37b89c1f9eff2a065976588745b6bf5cfc19025 /ftp
parenteccefbfbbb913e9a7275b5213ef543d17181a77d (diff)
downloadports-772ac3852f89750a9c215b7c2972d7c122b53693.tar.gz
ports-772ac3852f89750a9c215b7c2972d7c122b53693.zip
Sync with ftp/wu-ftpd: Add -current utmpx support
Notes
Notes: svn path=/head/; revision=248524
Diffstat (limited to 'ftp')
-rw-r--r--ftp/wu-ftpd+ipv6/Makefile9
-rw-r--r--ftp/wu-ftpd+ipv6/files/logwtmp.c24
2 files changed, 32 insertions, 1 deletions
diff --git a/ftp/wu-ftpd+ipv6/Makefile b/ftp/wu-ftpd+ipv6/Makefile
index 56287f652554..d10554743136 100644
--- a/ftp/wu-ftpd+ipv6/Makefile
+++ b/ftp/wu-ftpd+ipv6/Makefile
@@ -43,4 +43,11 @@ MAN5= ftpaccess.5 ftphosts.5 ftpconversions.5 xferlog.5 \
ftpservers.5
MAN8= ftpd.8 ftpshut.8 ftprestart.8 privatepw.8
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 900007
+post-patch:
+ ${CP} ${FILESDIR}/logwtmp.c ${WRKSRC}/src
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/ftp/wu-ftpd+ipv6/files/logwtmp.c b/ftp/wu-ftpd+ipv6/files/logwtmp.c
new file mode 100644
index 000000000000..81fcf8fc6d30
--- /dev/null
+++ b/ftp/wu-ftpd+ipv6/files/logwtmp.c
@@ -0,0 +1,24 @@
+#include "config.h"
+#include "proto.h"
+
+#include <utmpx.h>
+
+void
+wu_logwtmp(char *line, char *name, char *host, int login)
+{
+ struct utmpx utx;
+
+ memset(&utx, 0, sizeof(utx));
+ utx.ut_pid = getpid();
+ snprintf(utx.ut_id, sizeof utx.ut_id, "%xftp", utx.ut_pid);
+ gettimeofday(&utx.ut_tv, NULL);
+ if (login) {
+ utx.ut_type = USER_PROCESS;
+ strncpy(utx.ut_user, name, sizeof(utx.ut_user));
+ strncpy(utx.ut_host, host, sizeof(utx.ut_host));
+ strncpy(utx.ut_line, line, sizeof(utx.ut_line));
+ } else {
+ utx.ut_type = DEAD_PROCESS;
+ }
+ pututxline(&utx);
+}