Source-Changes-HG archive

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

[src/trunk]: src/libexec/ftpd rename local copies of login(), logout() and lo...



details:   https://anonhg.NetBSD.org/src/rev/81e62792e2a1
branches:  trunk
changeset: 543333:81e62792e2a1
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Feb 23 13:04:37 2003 +0000

description:
rename local copies of login(), logout() and logwtmp() to
ftpd_login(), ftpd_logout() and ftpd_logwtmp() respectively.
(makes utmp support much easier in tnftpd).

per suggestion in mail from Mike Heffner <mheffner%vt.edu@localhost>, who
forwarded patch from Michael Ranner <mranner%inode.at@localhost>.

diffstat:

 libexec/ftpd/extern.h  |  13 +++++++++----
 libexec/ftpd/ftpd.c    |  13 ++++++-------
 libexec/ftpd/logutmp.c |   8 ++++++--
 libexec/ftpd/logwtmp.c |   6 +++---
 libexec/ftpd/version.h |   4 ++--
 5 files changed, 26 insertions(+), 18 deletions(-)

diffs (175 lines):

diff -r 5083c2249501 -r 81e62792e2a1 libexec/ftpd/extern.h
--- a/libexec/ftpd/extern.h     Sun Feb 23 12:31:29 2003 +0000
+++ b/libexec/ftpd/extern.h     Sun Feb 23 13:04:37 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.46 2003/02/19 23:12:20 matt Exp $ */
+/*     $NetBSD: extern.h,v 1.47 2003/02/23 13:04:37 lukem Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -147,9 +147,6 @@
 void   init_curclass(void);
 void   logxfer(const char *, off_t, const char *, const char *,
            const struct timeval *, const char *);
-#if 0
-void   logwtmp(const char *, const char *, const char *);
-#endif
 struct tab *lookup(struct tab *, const char *);
 void   makedir(const char *);
 void   mlsd(const char *);
@@ -184,6 +181,14 @@
 char   *xstrdup(const char *);
 void   yyerror(char *);
 
+#ifdef SUPPORT_UTMP
+struct utmp;
+
+void   ftpd_logwtmp(const char *, const char *, const char *);
+void   ftpd_login(const struct utmp *ut);
+int    ftpd_logout(const char *line);
+#endif
+
 #include <netinet/in.h>
 
 #if defined(__NetBSD__)
diff -r 5083c2249501 -r 81e62792e2a1 libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Sun Feb 23 12:31:29 2003 +0000
+++ b/libexec/ftpd/ftpd.c       Sun Feb 23 13:04:37 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpd.c,v 1.151 2003/02/19 18:26:48 dsl Exp $   */
+/*     $NetBSD: ftpd.c,v 1.152 2003/02/23 13:04:37 lukem Exp $ */
 
 /*
  * Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpd.c     8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: ftpd.c,v 1.151 2003/02/19 18:26:48 dsl Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.152 2003/02/23 13:04:37 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -948,10 +948,10 @@
                (void)strncpy(utmp.ut_name, name, sizeof(utmp.ut_name));
                (void)strncpy(utmp.ut_line, line, sizeof(utmp.ut_line));
                (void)strncpy(utmp.ut_host, host, sizeof(utmp.ut_host));
-               login(&utmp);
+               ftpd_login(&utmp);
        }
        if (dowtmp)
-               logwtmp(line, name, host);
+               ftpd_logwtmp(line, name, host);
 #endif
 }
 
@@ -965,7 +965,7 @@
                        okwtmp = logoutx(ttyline, 0, DEAD_PROCESS) & dowtmp;
 #endif
 #ifdef SUPPORT_UTMP
-                       okwtmp = logout(ttyline) & dowtmp;
+                       okwtmp = ftpd_logout(ttyline) & dowtmp;
 #endif
                }
                if (okwtmp) {
@@ -973,7 +973,7 @@
                        logwtmpx(ttyline, "", "", 0, DEAD_PROCESS);
 #endif
 #ifdef SUPPORT_UTMP
-                       logwtmp(ttyline, "", "");
+                       ftpd_logwtmp(ttyline, "", "");
 #endif
                }
        }
@@ -3115,7 +3115,6 @@
                syslog(LOG_INFO, "%s", buf);
        }
 
-
                /*
                 * syslog wu-ftpd style log entry, prefixed with "xferlog: "
                 */
diff -r 5083c2249501 -r 81e62792e2a1 libexec/ftpd/logutmp.c
--- a/libexec/ftpd/logutmp.c    Sun Feb 23 12:31:29 2003 +0000
+++ b/libexec/ftpd/logutmp.c    Sun Feb 23 13:04:37 2003 +0000
@@ -33,8 +33,10 @@
  */
 
 #include <sys/types.h>
+#include <sys/param.h>
 
 #include <fcntl.h>
+#include <setjmp.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -43,6 +45,8 @@
 #include <utmp.h>
 #include <util.h>
 
+#include "extern.h"
+
 typedef struct utmp UTMP;
 
 static int fd = -1;
@@ -54,7 +58,7 @@
  */
 
 void
-login(const UTMP *ut)
+ftpd_login(const struct utmp *ut)
 {
        UTMP ubuf;
 
@@ -94,7 +98,7 @@
 }
 
 int
-logout(const char *line)
+ftpd_logout(const char *line)
 {
        UTMP ut;
        int rval;
diff -r 5083c2249501 -r 81e62792e2a1 libexec/ftpd/logwtmp.c
--- a/libexec/ftpd/logwtmp.c    Sun Feb 23 12:31:29 2003 +0000
+++ b/libexec/ftpd/logwtmp.c    Sun Feb 23 13:04:37 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: logwtmp.c,v 1.18 2002/09/13 02:58:54 itojun Exp $      */
+/*     $NetBSD: logwtmp.c,v 1.19 2003/02/23 13:04:37 lukem Exp $       */
 
 /*
  * Copyright (c) 1988, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)logwtmp.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: logwtmp.c,v 1.18 2002/09/13 02:58:54 itojun Exp $");
+__RCSID("$NetBSD: logwtmp.c,v 1.19 2003/02/23 13:04:37 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -73,7 +73,7 @@
  * after login, but before logout).
  */
 void
-logwtmp(const char *line, const char *name, const char *host)
+ftpd_logwtmp(const char *line, const char *name, const char *host)
 {
        struct utmp ut;
        struct stat buf;
diff -r 5083c2249501 -r 81e62792e2a1 libexec/ftpd/version.h
--- a/libexec/ftpd/version.h    Sun Feb 23 12:31:29 2003 +0000
+++ b/libexec/ftpd/version.h    Sun Feb 23 13:04:37 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.51 2003/02/23 08:33:13 lukem Exp $       */
+/*     $NetBSD: version.h,v 1.52 2003/02/23 13:04:37 lukem Exp $       */
 /*-
  * Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,5 +36,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define        FTPD_VERSION    "NetBSD-ftpd 20030219"
+#define        FTPD_VERSION    "NetBSD-ftpd 20030223"
 #endif



Home | Main Index | Thread Index | Old Index