Date: Tue, 7 Dec 2004 21:21:50 GMT From: Alexander Melkov <melkov@comptek.ru> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/74823: ftpd should not use warn(x) more carefully when used from inetd [patch] Message-ID: <200412072121.iB7LLo7Y047971@www.freebsd.org> Resent-Message-ID: <200412072130.iB7LUDqZ008532@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 74823
>Category: bin
>Synopsis: ftpd should not use warn(x) more carefully when used from inetd [patch]
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Dec 07 21:30:13 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Alexander Melkov
>Release: 5.3
>Organization:
>Environment:
FreeBSD melkov.ru 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Tue Nov 9 14:59:22 MSK 2004 spamtrap@melkov.ru:/usr/obj/usr/src/sys/MELKOV i386
>Description:
When ftpd is invoked from inetd, every call to warn(x), err(x) functions produces an output that is not compliant with rfc959, etc.
This particularly happens when incorrect start-up parameters specified (that's silly, yet my internet service provider's ftp server is configured that way right now ;) ).
>How-To-Repeat:
Write
ftp stream tcp nowait root /usr/libexec/ftpd ftpd -AWK
into /etc/inetd.conf and restart inetd
Run
ftp localhost
'ftp' program will fail to establish connection
Run
nc localhost 21
see
ftpd: illegal option -- K
ftpd: unknown flag -K ignored
220 ...... FTP server (Version 6.00LS) ready.
>Fix:
ftpd.c is 1.163
diff ftpd.c.1.163 ftpd.c
286a287
> struct stat st;
290a292,296
>
> if (fstat(0, &st) == 0 && (st.st_mode & S_IFMT) == S_IFSOCK) {
> extern char *__progname;
> __progname = "220-";
> }
- this is not a graceful solution, yet a warnx call from getopt function should be covered somehow.
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412072121.iB7LLo7Y047971>
