Date: Mon, 14 Feb 2000 13:10:59 +0900 (JST) From: kjm@rins.ryukoku.ac.jp To: FreeBSD-gnats-submit@freebsd.org Subject: bin/16705: ftpd doesn't support -h option Message-ID: <200002140410.NAA73174@ideon.st.ryukoku.ac.jp>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002140410.NAA73174>
