summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbitblt <bitblt@openbsd.org>2000-03-03 15:51:45 +0000
committerbitblt <bitblt@openbsd.org>2000-03-03 15:51:45 +0000
commit7effe28194e0561403a6c809104ea7a21c651c87 (patch)
treeec6e5bcc516b25f83b7b12148176d5f06af4ec83
parentremove WIDE's experimental ip reass code, mistakingly merged in partially. (diff)
downloadwireguard-openbsd-7effe28194e0561403a6c809104ea7a21c651c87.tar.xz
wireguard-openbsd-7effe28194e0561403a6c809104ea7a21c651c87.zip
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
-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");