summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorbitblt <bitblt@cvs.openbsd.org>2000-03-03 15:51:46 +0000
committerbitblt <bitblt@cvs.openbsd.org>2000-03-03 15:51:46 +0000
commite84367253c591b221a4992b5a352a0e82f25b65c (patch)
tree51b7e0f690ba4ee4d1bd5b519f970bc00a3acf0b /libexec
parent72b4104e7519506660b0473da1ebb287c59b7e94 (diff)
Turns out that our implementation of STAT wasn't RFC 959 compliant.
This version is now RFC 959 compliant, using a patch adapted from one sent in by david.leonard@eecs.uq.edu.au
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index fc926ad130e..1c443f5e779 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.68 2000/01/18 18:26:38 millert Exp $ */
+/* $OpenBSD: ftpd.c,v 1.69 2000/03/03 15:51:45 bitblt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -1617,11 +1617,13 @@ statfilecmd(filename)
{
FILE *fin;
int c;
+ int atstart;
char line[LINE_MAX];
(void)snprintf(line, sizeof(line), "/bin/ls -lgA %s", filename);
fin = ftpd_popen(line, "r");
lreply(211, "status of %s:", filename);
+ atstart = 1;
while ((c = getc(fin)) != EOF) {
if (c == '\n') {
if (ferror(stdout)){
@@ -1637,7 +1639,10 @@ statfilecmd(filename)
}
(void) putc('\r', stdout);
}
+ if (atstart && isdigit(c))
+ (void) putc(' ', stdout);
(void) putc(c, stdout);
+ atstart = (c == '\n');
}
(void) ftpd_pclose(fin);
reply(211, "End of Status");