pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/proftpd Make it log in wtmpx properly.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e7acdb5bd313
branches:  trunk
changeset: 496103:e7acdb5bd313
user:      christos <christos%pkgsrc.org@localhost>
date:      Thu Jun 23 04:49:26 2005 +0000

description:
Make it log in wtmpx properly.
XXX: someone should fix the array has type char issues.

diffstat:

 net/proftpd/Makefile         |   4 +-
 net/proftpd/distinfo         |   3 +-
 net/proftpd/patches/patch-ac |  60 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 3 deletions(-)

diffs (90 lines):

diff -r 97d2a1bd2aba -r e7acdb5bd313 net/proftpd/Makefile
--- a/net/proftpd/Makefile      Thu Jun 23 04:15:47 2005 +0000
+++ b/net/proftpd/Makefile      Thu Jun 23 04:49:26 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.22 2005/06/22 22:43:37 salo Exp $
+# $NetBSD: Makefile,v 1.23 2005/06/23 04:49:26 christos Exp $
 
 DISTNAME=      proftpd-1.2.10
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    net
 MASTER_SITES=  ftp://ftp.proftpd.org/distrib/source/ \
                ftp://ftp.servus.at/ProFTPD/distrib/source/ \
diff -r 97d2a1bd2aba -r e7acdb5bd313 net/proftpd/distinfo
--- a/net/proftpd/distinfo      Thu Jun 23 04:15:47 2005 +0000
+++ b/net/proftpd/distinfo      Thu Jun 23 04:49:26 2005 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.10 2005/06/22 22:43:37 salo Exp $
+$NetBSD: distinfo,v 1.11 2005/06/23 04:49:26 christos Exp $
 
 SHA1 (proftpd-1.2.10.tar.gz) = ea12d139b8b47168cabcd993b137b2360bba1465
 RMD160 (proftpd-1.2.10.tar.gz) = c96cadc6bfef0f77f2d44ed901b55474c6f6a464
 Size (proftpd-1.2.10.tar.gz) = 1182176 bytes
 SHA1 (patch-aa) = 3784f6aed87b327741685d45d453aa2ac98dd98b
 SHA1 (patch-ab) = cc760fc91846a0fc595e2e76d5a1ef582915034d
+SHA1 (patch-ac) = fc6cb354338338d724d78151c37b256a80842307
diff -r 97d2a1bd2aba -r e7acdb5bd313 net/proftpd/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/proftpd/patches/patch-ac      Thu Jun 23 04:49:26 2005 +0000
@@ -0,0 +1,60 @@
+$NetBSD: patch-ac,v 1.1 2005/06/23 04:49:26 christos Exp $
+
+--- src/log.c.orig     2004-08-07 18:22:42.000000000 -0400
++++ src/log.c  2005-06-23 00:42:29.000000000 -0400
+@@ -59,7 +59,8 @@
+   int res = 0;
+   static int fd = -1;
+ 
+-#if (defined(SVR4) || defined(__SVR4)) && \
++#if ((defined(SVR4) || defined(__SVR4)) || \
++    (defined(__NetBSD__) && defined(HAVE_UTMPX_H))) && \
+     !(defined(LINUX) || defined(__hpux) || defined (_AIX))
+   /* This "auxilliary" utmp doesn't exist under linux. */
+ #ifdef __sparcv9
+@@ -70,6 +71,10 @@
+ #endif
+   static int fdx = -1;
+ 
++#if !defined(WTMPX_FILE) && defined(_PATH_WTMPX)
++# define WTMPX_FILE _PATH_WTMPX
++#endif
++
+   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));
+@@ -89,14 +94,30 @@
+     sstrncpy(utx.ut_id, "ftp", sizeof(utx.ut_user));
+     sstrncpy(utx.ut_line, line, sizeof(utx.ut_line));
+     sstrncpy(utx.ut_host, host, sizeof(utx.ut_host));
+-    utx.ut_syslen = strlen(utx.ut_host)+1;
+     utx.ut_pid = getpid();
+-#ifdef __sparcv9
++#if defined(__NetBSD__) && defined(HAVE_UTMPX_H)
++    {
++      /* XXX: may return (size_t) -1 */
++      size_t len = pr_netaddr_get_inaddr_len(ip);
++      if (len > sizeof(utx.ut_ss))
++              len = sizeof(utx.ut_ss);
++#  ifndef USE_IPV6
++      memcpy(&utx.ut_ss, pr_netaddr_get_inaddr(ip), len);
++#  else
++      memcpy(&utx.ut_ss, pr_netaddr_get_inaddr(ip), len);
++#  endif /* !USE_IPV6 */
++    }
++    gettimeofday(&utx.ut_tv, NULL);
++#else /* SVR4 */
++    utx.ut_syslen = strlen(utx.ut_host)+1;
++#  ifdef __sparcv9
+     time(&t);
+     utx.ut_tv.tv_sec = (time32_t)t;
+-#else
++#  else
+     time(&utx.ut_tv.tv_sec);
+-#endif
++#  endif
++#endif /* SVR4 */
++
+     if (*name)
+       utx.ut_type = USER_PROCESS;
+     else



Home | Main Index | Thread Index | Old Index