Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jun 2002 08:50:03 -0700 (PDT)
From:      Jonathan Towne <jontow@twcny.rr.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/16705: ftpd doesn't support -h option
Message-ID:  <200206091550.g59Fo3r62581@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/16705; it has been noted by GNATS.

From: Jonathan Towne <jontow@twcny.rr.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc: kjm@rins.ryukoku.ac.jp
Subject: Re: bin/16705: ftpd doesn't support -h option
Date: Sun, 9 Jun 2002 11:45:10 -0400

 --tqI+Z3u+9OQ7kwn0
 Content-Type: text/plain; charset=us-ascii
 
 Good feature to have, and good point about telnetd including it, but
 ftpd not.. this patch applies cleanly to -CURRENT as of
 Sunday, June 9, ~10:30am EDT.
 
 - Jonathan Towne
 
 --tqI+Z3u+9OQ7kwn0
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="ftpd.hinfo.fbsd5.patch"
 
 *** ftpd.c.orig	Tue May 28 14:55:04 2002
 --- ftpd.c	Sun Jun  9 11:36:05 2002
 ***************
 *** 139,144 ****
 --- 139,145 ----
   int	mode;
   int	usedefault = 1;		/* for data transfers */
   int	pdata = -1;		/* for passive mode */
 + int	hostinfo = 1;		/* do we print login banner? */
   int	readonly=0;		/* Server is in readonly mode.	*/
   int	noepsv=0;		/* EPSV command is disabled.	*/
   int	noretr=0;		/* RETR command is disabled.	*/
 ***************
 *** 297,303 ****
   #endif /* OLD_SETPROCTITLE */
   
   
 ! 	while ((ch = getopt(argc, argv, "AdlDESURrt:T:u:vOoa:p:46")) != -1) {
   		switch (ch) {
   		case 'D':
   			daemon_mode++;
 --- 298,304 ----
   #endif /* OLD_SETPROCTITLE */
   
   
 ! 	while ((ch = getopt(argc, argv, "AdlhDESURrt:T:u:vOoa:p:46")) != -1) {
   		switch (ch) {
   		case 'D':
   			daemon_mode++;
 ***************
 *** 388,393 ****
 --- 389,398 ----
   			noretr = 1;
   			break;
   
 + 		case 'h':
 + 			hostinfo = 0;
 + 			break;
 + 
   		default:
   			warnx("unknown flag -%c ignored", optopt);
   			break;
 ***************
 *** 620,626 ****
   	(void) gethostname(hostname, MAXHOSTNAMELEN - 1);
   	hostname[MAXHOSTNAMELEN - 1] = '\0';
   #endif
 ! 	reply(220, "%s FTP server (%s) ready.", hostname, version);
   	for (;;)
   		(void) yyparse();
   	/* NOTREACHED */
 --- 625,636 ----
   	(void) gethostname(hostname, MAXHOSTNAMELEN - 1);
   	hostname[MAXHOSTNAMELEN - 1] = '\0';
   #endif
 ! 
 ! 	if (hostinfo)
 ! 		reply(220, "%s FTP server (%s) ready.", hostname, version);
 ! 	else
 ! 		reply(220, "Service ready.");
 ! 
   	for (;;)
   		(void) yyparse();
   	/* NOTREACHED */
 ***************
 *** 1438,1443 ****
 --- 1448,1455 ----
   			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.orig	Mon Oct  1 08:58:03 2001
 --- ftpd.8	Sun Jun  9 11:32:23 2002
 ***************
 *** 42,47 ****
 --- 42,48 ----
   .Nm
   .Op Fl 46ADEORSUdro
   .Op Fl l Op Fl l
 + .Op Fl h
   .Op Fl T Ar maxtimeout
   .Op Fl a Ar address
   .Op Fl p Ar file
 ***************
 *** 149,154 ****
 --- 150,158 ----
   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 T
   A client may also request a different timeout period;
   the maximum period allowed may be set to
 
 --tqI+Z3u+9OQ7kwn0--

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?200206091550.g59Fo3r62581>