Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/libexec/ftpd Pull up revision 1.19 (requested by itojun...
details: https://anonhg.NetBSD.org/src/rev/2d67b3682d8e
branches: netbsd-1-6
changeset: 529194:2d67b3682d8e
user: tron <tron%NetBSD.org@localhost>
date: Fri Nov 01 08:23:39 2002 +0000
description:
Pull up revision 1.19 (requested by itojun in ticket #942):
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@localhost
openbsd libexec/ftpd/ftpd.c revision 1.69.
(see RFC959 page 36)
diffstat:
libexec/ftpd/cmds.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (52 lines):
diff -r e1f1471d511b -r 2d67b3682d8e libexec/ftpd/cmds.c
--- a/libexec/ftpd/cmds.c Thu Oct 24 10:37:35 2002 +0000
+++ b/libexec/ftpd/cmds.c Fri Nov 01 08:23:39 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmds.c,v 1.16 2002/02/13 15:15:23 lukem Exp $ */
+/* $NetBSD: cmds.c,v 1.16.2.1 2002/11/01 08:23:39 tron Exp $ */
/*
* Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: cmds.c,v 1.16 2002/02/13 15:15:23 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.16.2.1 2002/11/01 08:23:39 tron Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -117,6 +117,7 @@
#include <string.h>
#include <tzfile.h>
#include <unistd.h>
+#include <ctype.h>
#ifdef KERBEROS5
#include <krb5/krb5.h>
@@ -506,12 +507,14 @@
{
FILE *fin;
int c;
+ int atstart;
char *argv[] = { INTERNAL_LS, "-lgA", "", NULL };
argv[2] = (char *)filename;
fin = ftpd_popen(argv, "r", STDOUT_FILENO);
reply(-211, "status of %s:", filename);
/* XXX: use fgetln() or fparseln() here? */
+ atstart = 1;
while ((c = getc(fin)) != EOF) {
if (c == '\n') {
if (ferror(stdout)){
@@ -527,7 +530,10 @@
}
CPUTC('\r', stdout);
}
+ if (atstart && isdigit(c))
+ CPUTC(' ', stdout);
CPUTC(c, stdout);
+ atstart = (c == '\n');
}
(void) ftpd_pclose(fin);
reply(211, "End of Status");
Home |
Main Index |
Thread Index |
Old Index