From 478d73b2353de5b14ca8a788d6daf5e77e85140d Mon Sep 17 00:00:00 2001 From: yar Date: Mon, 16 Jun 2003 11:30:23 +0000 Subject: If ftpd is run with an -h option (hide host-specific info,) don't reveal the info in reply to the SYST command. Get rid of using the "unix" macro at the same time. It was a rather poor way to check if the system was Unix since there were quite a few Unix clones out there whose cc didn't define "unix" (e.g., NetBSD.) It was also sensitive to the C standard used, which caused unnecessary trouble: With -std=c99, it should have been "__unix__", and so on. PR: bin/50690 Submitted by: Alex Semenyaka MFC after: 1 week --- libexec/ftpd/ftpcmd.y | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libexec') diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 49fc1ff..1b32a2a 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -688,17 +688,17 @@ cmd } | SYST check_login CRLF { - if ($2) -#ifdef unix + if ($2) { + if (hostinfo) #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); -#endif /* unix */ + else + reply(215, "UNKNOWN Type: L%d", CHAR_BIT); + } } /* -- cgit v1.1