ftpd -h

Alex Semenyaka alexs at ratmir.ru
Fri Apr 4 16:17:24 PST 2003


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


More information about the freebsd-hackers mailing list