Source-Changes-HG archive

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

[src/trunk]: src/libexec/ftpd suppress verbose messages from CWD and post-log...



details:   https://anonhg.NetBSD.org/src/rev/a79ba2f91cfd
branches:  trunk
changeset: 480441:a79ba2f91cfd
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Jan 13 00:04:31 2000 +0000

description:
suppress verbose messages from CWD and post-login if the first
character of the anonymous password is `-'.

diffstat:

 libexec/ftpd/conf.c    |  10 ++++++++--
 libexec/ftpd/extern.h  |   3 ++-
 libexec/ftpd/ftpd.8    |  11 +++++++++--
 libexec/ftpd/ftpd.c    |  11 +++++++++--
 libexec/ftpd/version.h |   4 ++--
 5 files changed, 30 insertions(+), 9 deletions(-)

diffs (149 lines):

diff -r f345fe46aa74 -r a79ba2f91cfd libexec/ftpd/conf.c
--- a/libexec/ftpd/conf.c       Wed Jan 12 22:39:27 2000 +0000
+++ b/libexec/ftpd/conf.c       Thu Jan 13 00:04:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.28 2000/01/12 22:39:27 lukem Exp $  */
+/*     $NetBSD: conf.c,v 1.29 2000/01/13 00:04:31 lukem Exp $  */
 
 /*-
  * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: conf.c,v 1.28 2000/01/12 22:39:27 lukem Exp $");
+__RCSID("$NetBSD: conf.c,v 1.29 2000/01/13 00:04:31 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -472,6 +472,9 @@
        char     cwd[MAXPATHLEN];
        char    *cp, **rlist;
 
+       if (quietmessages)
+               return;
+
                /* Setup list for directory cache */
        if (slist == NULL)
                slist = sl_init();
@@ -534,6 +537,9 @@
        off_t   b;
        time_t  now;
 
+       if (quietmessages)
+               return (0);
+
 #define PUTC(x)        putchar(x), b++
 
        if (EMPTYSTR(file))
diff -r f345fe46aa74 -r a79ba2f91cfd libexec/ftpd/extern.h
--- a/libexec/ftpd/extern.h     Wed Jan 12 22:39:27 2000 +0000
+++ b/libexec/ftpd/extern.h     Thu Jan 13 00:04:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.23 2000/01/12 22:39:28 lukem Exp $        */
+/*     $NetBSD: extern.h,v 1.24 2000/01/13 00:04:31 lukem Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -221,6 +221,7 @@
 GLOBAL int             pdata;
 GLOBAL char            proctitle[];
 GLOBAL struct passwd  *pw;
+GLOBAL int             quietmessages;
 GLOBAL char            remotehost[];
 GLOBAL off_t           restart_point;
 GLOBAL char            tmpline[];
diff -r f345fe46aa74 -r a79ba2f91cfd libexec/ftpd/ftpd.8
--- a/libexec/ftpd/ftpd.8       Wed Jan 12 22:39:27 2000 +0000
+++ b/libexec/ftpd/ftpd.8       Thu Jan 13 00:04:31 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ftpd.8,v 1.49 2000/01/08 11:09:56 lukem Exp $
+.\"    $NetBSD: ftpd.8,v 1.50 2000/01/13 00:04:31 lukem Exp $
 .\"
 .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -67,7 +67,7 @@
 .\"
 .\"     @(#)ftpd.8     8.2 (Berkeley) 4/19/94
 .\"
-.Dd January 8, 2000
+.Dd January 13, 2000
 .Dt FTPD 8
 .Os
 .Sh NAME
@@ -348,6 +348,13 @@
 entries in
 .Xr ftpd.conf 5
 are required.
+.Pp
+If the first character of the password supplied by an anonymous user
+is
+.Dq - ,
+then the verbose messages displayed at login and upon a
+.Sy CWD
+command are suppressed.
 .El
 .Sh Display file escape sequences
 .Pp
diff -r f345fe46aa74 -r a79ba2f91cfd libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Wed Jan 12 22:39:27 2000 +0000
+++ b/libexec/ftpd/ftpd.c       Thu Jan 13 00:04:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpd.c,v 1.84 2000/01/12 22:39:28 lukem Exp $  */
+/*     $NetBSD: ftpd.c,v 1.85 2000/01/13 00:04:31 lukem Exp $  */
 
 /*
  * Copyright (c) 1997-2000 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.84 2000/01/12 22:39:28 lukem Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.85 2000/01/13 00:04:31 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -778,6 +778,7 @@
        }
        pw = NULL;
        logged_in = 0;
+       quietmessages = 0;
        curclass.type = CLASS_REAL;
 }
 
@@ -983,6 +984,9 @@
        }
        setenv("HOME", home, 1);
 
+       if (curclass.type == CLASS_GUEST && passwd[0] == '-')
+               quietmessages = 1;
+
        /*
         * Display a login message, if it exists.
         * N.B. reply(230,) must follow the message.
@@ -1934,6 +1938,9 @@
                lreply(0,
            "Upload commands (APPE, STOR, STOU): %sabled",
                    curclass.upload ? "en" : "dis");
+               if (curclass.portmin && curclass.portmax)
+                       lreply(0, "PASV port range: %d - %d",
+                           curclass.portmin, curclass.portmax);
                if (curclass.rateget)
                        lreply(0, "Rate get limit: %d bytes/sec",
                            curclass.rateget);
diff -r f345fe46aa74 -r a79ba2f91cfd libexec/ftpd/version.h
--- a/libexec/ftpd/version.h    Wed Jan 12 22:39:27 2000 +0000
+++ b/libexec/ftpd/version.h    Thu Jan 13 00:04:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.6 2000/01/12 22:39:29 lukem Exp $        */
+/*     $NetBSD: version.h,v 1.7 2000/01/13 00:04:32 lukem Exp $        */
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,5 +36,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define        FTPD_VERSION    "Version: NetBSD-ftpd/20000111"
+#define        FTPD_VERSION    "Version: NetBSD-ftpd/20000113"
 #endif



Home | Main Index | Thread Index | Old Index