Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 04:17:19 +0400
From:      Alex Semenyaka <alexs@ratmir.ru>
To:        Socketd <db@traceroute.dk>
Cc:        hackers@freebsd.org
Subject:   Re: ftpd -h
Message-ID:  <20030405001719.GA90728@snark.ratmir.ru>
In-Reply-To: <20030404230140.GC17008@main>
References:  <20030404230140.GC17008@main>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 05, 2003 at 01:01:40AM +0200, Socketd wrote:
> When updating to FreeBSD 4.8 I saw that you can give ftpd a -h flag 
> when writing "syst" I still get:
> 215 UNIX Type: L8 Version: BSD-199506

You are right, there is no check. Here is the patch to fix it:

Index: ftpcmd.y
===================================================================
RCS file: /usr/local/FreeBSD/src/libexec/ftpd/ftpcmd.y,v
retrieving revision 1.50
diff -u -U1 -r1.50 ftpcmd.y
--- ftpcmd.y	5 Feb 2003 11:11:32 -0000	1.50
+++ ftpcmd.y	5 Apr 2003 00:11:58 -0000
@@ -690,13 +690,17 @@
 		{
-			if ($2)
+			if ($2) {
+				if (hostinfo)
 #ifdef unix
 #ifdef BSD
-			reply(215, "UNIX Type: L%d Version: BSD-%d",
-				CHAR_BIT, BSD);
+					reply(215, "UNIX Type: L%d Version: BSD-%d",
+					CHAR_BIT, BSD);
 #else /* BSD */
-			reply(215, "UNIX Type: L%d", CHAR_BIT);
+					reply(215, "UNIX Type: L%d", CHAR_BIT);
 #endif /* BSD */
 #else /* unix */
-			reply(215, "UNKNOWN Type: L%d", CHAR_BIT);
+					reply(215, "UNKNOWN Type: L%d", CHAR_BIT);
 #endif /* unix */
+				else
+					reply(215, "UNKNOWN Type: L%d", CHAR_BIT);
+				}
 		}


Comments?

Alex



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030405001719.GA90728>