summaryrefslogtreecommitdiffstats
path: root/libexec/ftpd/ftpcmd.y
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2003-06-16 11:30:23 +0000
committeryar <yar@FreeBSD.org>2003-06-16 11:30:23 +0000
commit478d73b2353de5b14ca8a788d6daf5e77e85140d (patch)
treeb53bd4f352f606ad585489b968ff3ede5b5a85d7 /libexec/ftpd/ftpcmd.y
parent5a341ceea0cbdc652b00645a7c1937a34fe936bf (diff)
downloadFreeBSD-src-478d73b2353de5b14ca8a788d6daf5e77e85140d.zip
FreeBSD-src-478d73b2353de5b14ca8a788d6daf5e77e85140d.tar.gz
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 <alexs _at_ snark.ratmir.ru> MFC after: 1 week
Diffstat (limited to 'libexec/ftpd/ftpcmd.y')
-rw-r--r--libexec/ftpd/ftpcmd.y16
1 files changed, 8 insertions, 8 deletions
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);
+ }
}
/*
OpenPOWER on IntegriCloud