From 5c8564e8a3f07366d90df303009755d95760696a Mon Sep 17 00:00:00 2001 From: Li-Wen Hsu Date: Tue, 26 Jun 2012 17:11:21 +0000 Subject: - Fix utmpx for FreeBSD 9+ - Seperate logwtmp.c patch from patch-gcc4 - Change MASTER_SITES because the original site has no ns record now - Undefine DISTNAME - Bump PORTREVISION PR: ports/169096 Submitted by: Hung-te Liang Approved by: Nick Leuta (maintainer) --- ftp/bsdftpd-ssl/files/patch-ftpd-logwtmp.c | 72 ++++++++++++++++++++++++++++++ ftp/bsdftpd-ssl/files/patch-gcc4 | 21 --------- 2 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 ftp/bsdftpd-ssl/files/patch-ftpd-logwtmp.c (limited to 'ftp/bsdftpd-ssl/files') diff --git a/ftp/bsdftpd-ssl/files/patch-ftpd-logwtmp.c b/ftp/bsdftpd-ssl/files/patch-ftpd-logwtmp.c new file mode 100644 index 000000000000..1347aa3b665a --- /dev/null +++ b/ftp/bsdftpd-ssl/files/patch-ftpd-logwtmp.c @@ -0,0 +1,72 @@ +diff -urN bsdftpd-ssl-1.1.0.ORI/ftpd/logwtmp.c ftpd/logwtmp.c +--- bsdftpd-ssl-1.1.0.ORI/ftpd/logwtmp.c 2004-12-20 02:44:42.000000000 +0800 ++++ ftpd/logwtmp.c 2012-06-15 15:34:03.000000000 +0800 +@@ -48,13 +48,18 @@ + #include + #include + ++#include ++#if __FreeBSD_version < 900007 + #include + #include +-#if 0 /* Original FreeBSD 5.0 code */ ++#if 1 /* Original FreeBSD 5.0 code */ + #include + #endif + #include + #include ++#else ++#include ++#endif + #include + #include + #include +@@ -63,6 +68,7 @@ + + #include + ++#ifndef _UTMPX_H_ + static int fd = -1; + + /* +@@ -94,7 +100,7 @@ + (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line)); + (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name)); + (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host)); +-#if 0 /* Original FreeBSD 5.0 code */ ++#if 1 /* Original FreeBSD 5.0 code */ + ut.ut_time = _time_to_time32(time(NULL)); + #else /* Portable code from FreeBSD 4.8 */ + (void)time(&ut.ut_time); +@@ -104,3 +110,31 @@ + (void)ftruncate(fd, buf.st_size); + } + } ++#else /* Original FreeBSD 9.0 code */ ++void ++ftpd_logwtmp(char *id, char *user, struct sockaddr *addr) ++{ ++ struct utmpx ut; ++ ++ memset(&ut, 0, sizeof(ut)); ++ ++ if (user != NULL) { ++ /* Log in. */ ++ ut.ut_type = USER_PROCESS; ++ (void)strncpy(ut.ut_user, user, sizeof(ut.ut_user)); ++ if (addr != NULL) ++ realhostname_sa(ut.ut_host, sizeof(ut.ut_host), ++ addr, addr->sa_len); ++ } else { ++ /* Log out. */ ++ ut.ut_type = DEAD_PROCESS; ++ } ++ ++ ut.ut_pid = getpid(); ++ gettimeofday(&ut.ut_tv, NULL); ++ (void)strncpy(ut.ut_id, id, sizeof(ut.ut_id)); ++ (void)strncpy(ut.ut_line, "ftpd", sizeof(ut.ut_line)); ++ ++ pututxline(&ut); ++} ++#endif diff --git a/ftp/bsdftpd-ssl/files/patch-gcc4 b/ftp/bsdftpd-ssl/files/patch-gcc4 index 1f3ba1d36fc9..0b8c8f53a10b 100644 --- a/ftp/bsdftpd-ssl/files/patch-gcc4 +++ b/ftp/bsdftpd-ssl/files/patch-gcc4 @@ -151,27 +151,6 @@ diff -urN bsdftpd-ssl-1.1.0.ORI/ftpd/ftpd.c ftpd/ftpd.c char *p, *a; if (pdata >= 0) /* close old port if one set */ -diff -urN bsdftpd-ssl-1.1.0.ORI/ftpd/logwtmp.c ftpd/logwtmp.c ---- bsdftpd-ssl-1.1.0.ORI/ftpd/logwtmp.c 2004-12-19 21:44:42.000000000 +0300 -+++ ftpd/logwtmp.c 2007-08-26 15:37:16.000000000 +0400 -@@ -50,7 +50,7 @@ - - #include - #include --#if 0 /* Original FreeBSD 5.0 code */ -+#if 1 /* Original FreeBSD 5.0 code */ - #include - #endif - #include -@@ -94,7 +94,7 @@ - (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line)); - (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name)); - (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host)); --#if 0 /* Original FreeBSD 5.0 code */ -+#if 1 /* Original FreeBSD 5.0 code */ - ut.ut_time = _time_to_time32(time(NULL)); - #else /* Portable code from FreeBSD 4.8 */ - (void)time(&ut.ut_time); diff -urN bsdftpd-ssl-1.1.0.ORI/port/bsd_prog.mk port/bsd_prog.mk --- bsdftpd-ssl-1.1.0.ORI/port/bsd_prog.mk 2003-04-05 13:42:20.000000000 +0400 +++ port/bsd_prog.mk 2007-08-26 14:53:23.000000000 +0400 -- cgit v1.2.3