From owner-freebsd-bugs Sun Feb 13 20:19:53 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by builder.freebsd.org (Postfix) with ESMTP id EA88C496E for ; Sun, 13 Feb 2000 20:19:49 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA38573; Sun, 13 Feb 2000 20:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from rins.st.ryukoku.ac.jp (rins.st.ryukoku.ac.jp [133.83.4.1]) by builder.freebsd.org (Postfix) with ESMTP id 73ECF3DB8 for ; Sun, 13 Feb 2000 20:11:00 -0800 (PST) Received: from ideon.st.ryukoku.ac.jp (ideon.st.ryukoku.ac.jp [133.83.36.5]) by rins.st.ryukoku.ac.jp (8.9.3+3.2W/3.7W/RINS-1.9.6-NOSPAM) with ESMTP id NAA10033 for ; Mon, 14 Feb 2000 13:11:00 +0900 (JST) Received: (from kjm@localhost) by ideon.st.ryukoku.ac.jp (8.9.3/3.7W/kjm-19990628) id NAA73174; Mon, 14 Feb 2000 13:10:59 +0900 (JST) Message-Id: <200002140410.NAA73174@ideon.st.ryukoku.ac.jp> Date: Mon, 14 Feb 2000 13:10:59 +0900 (JST) From: kjm@rins.ryukoku.ac.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/16705: ftpd doesn't support -h option Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 16705 >Category: bin >Synopsis: ftpd doesn't support -h option >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Feb 13 20:20:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: KOJIMA Hajime >Release: FreeBSD 3.4-RELEASE i386 >Organization: Ryukoku University >Environment: FreeBSD 3.4-RELEASE (x86) >Description: telnetd support -h option (Disable the printing of host-specific information before login has been completed), but ftpd(8) doesn't. >How-To-Repeat: % man ftpd ... SYNOPSIS ftpd [-d] [-l [-l]] [-A] [-D] [-R] [-S] [-U] [-T maxtimeout] [-t timeout] [-a address] [-p file] >Fix: Apply this patch: --- ftpd.c.dist Mon Feb 14 12:19:01 2000 +++ ftpd.c Mon Feb 14 12:55:01 2000 @@ -142,6 +142,7 @@ int mode; int usedefault = 1; /* for data transfers */ int pdata = -1; /* for passive mode */ +int hostinfo = 1; /* do we print login banner? */ sig_atomic_t transflag; off_t file_size; off_t byte_count; @@ -287,7 +288,7 @@ bind_address.s_addr = htonl(INADDR_ANY); - while ((ch = getopt(argc, argv, "AdlDSURt:T:u:va:p:")) != -1) { + while ((ch = getopt(argc, argv, "AdlhDSURt:T:u:va:p:")) != -1) { switch (ch) { case 'D': daemon_mode++; @@ -353,6 +354,10 @@ debug = 1; break; + case 'h': + hostinfo = 0; + break; + default: warnx("unknown flag -%c ignored", optopt); break; @@ -546,7 +551,10 @@ (void) gethostname(hostname, MAXHOSTNAMELEN - 1); hostname[MAXHOSTNAMELEN - 1] = '\0'; #endif - reply(220, "%s FTP server (%s) ready.", hostname, version); + if (hostinfo) + reply(220, "%s FTP server (%s) ready.", hostname, version); + else + reply(220, "Service ready."); (void) setjmp(errcatch); for (;;) (void) yyparse(); @@ -1103,6 +1111,9 @@ syslog(LOG_INFO, "ANONYMOUS FTP LOGIN FROM %s, %s", remotehost, passwd); } else { + if (!hostinfo) + lreply(230, "%s FTP server (%s) ready.", hostname, version); + if (dochroot) reply(230, "User %s logged in, access restrictions apply.", pw->pw_name); --- ftpd.8.dist Mon Feb 14 12:38:44 2000 +++ ftpd.8 Mon Feb 14 12:43:43 2000 @@ -43,6 +43,7 @@ .Nm ftpd .Op Fl d .Op Fl l Op Fl l +.Op Fl h .Op Fl A .Op Fl D .Op Fl R @@ -80,6 +81,9 @@ by default, and may have to be enabled in .Xr syslogd 8 Ns 's configuration file. +.It Fl h +Disable the printing of host-specific information before login +has been completed. .It Fl D With this option set, .Nm >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message