summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-02-26 00:15:55 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-02-26 00:15:55 +0000
commit4f60691b0ecec32e05f53c18261a02ab275bc5e5 (patch)
treeb7c8b9fbe365cd05fbbef587c2e13b88d945506c
parent624d21a8b4041d1179df49c18d3fd23b0d9e7ee3 (diff)
implement internal ls
-rw-r--r--libexec/ftpd/Makefile10
-rw-r--r--libexec/ftpd/ftpd.c4
-rw-r--r--libexec/ftpd/popen.c12
3 files changed, 20 insertions, 6 deletions
diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile
index 73d18e65749..ed079b0a150 100644
--- a/libexec/ftpd/Makefile
+++ b/libexec/ftpd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.13 1998/05/29 04:42:37 rahnds Exp $
+# $OpenBSD: Makefile,v 1.14 1999/02/26 00:15:54 art Exp $
# $NetBSD: Makefile,v 1.13 1996/02/16 02:07:41 cgd Exp $
# @(#)Makefile 8.2 (Berkeley) 4/4/94
@@ -7,10 +7,16 @@ CFLAGS+=-DHASSETPROCTITLE -Dunix
SRCS= ftpd.c ftpcmd.c logutmp.c logwtmp.c popen.c
MAN= ftpd.8
CLEANFILES+=ftpcmd.c y.tab.h
-.PATH: ${.CURDIR}/../../usr.bin/ftp
.include <bsd.own.mk>
+# our internal version of ls.
+
+LSDIR = ${.CURDIR}/../../bin/ls
+.PATH: ${LSDIR}
+SRCS += ls.c cmp.c print.c stat_flags.c util.c
+CFLAGS += -I${LSDIR}
+
.if (${SKEY} == "yes")
CFLAGS+=-DSKEY
LDADD+= -lskey
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index b8b74512ccc..67f69f787fa 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.52 1998/12/30 22:01:24 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.53 1999/02/26 00:15:54 art Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -106,7 +106,7 @@ static char rcsid[] = "$NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $"
#include <varargs.h>
#endif
-static char version[] = "Version 6.3/OpenBSD";
+static char version[] = "Version 6.4/OpenBSD";
extern off_t restart_point;
extern char cbuf[];
diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c
index f7f89ceaa74..c195cc2ccad 100644
--- a/libexec/ftpd/popen.c
+++ b/libexec/ftpd/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.9 1997/06/29 07:35:48 deraadt Exp $ */
+/* $OpenBSD: popen.c,v 1.10 1999/02/26 00:15:54 art Exp $ */
/* $NetBSD: popen.c,v 1.5 1995/04/11 02:45:00 cgd Exp $ */
/*
@@ -124,7 +124,8 @@ ftpd_popen(program, type)
gargv[gargc] = NULL;
iop = NULL;
- switch(pid = vfork()) {
+
+ switch(pid = fork()) {
case -1: /* error */
(void)close(pdes[0]);
(void)close(pdes[1]);
@@ -147,6 +148,13 @@ ftpd_popen(program, type)
}
closelog();
+ if (strcmp(gargv[0], "/bin/ls") == 0) {
+ extern int optreset;
+ /* reset getopt for ls_main */
+ optreset = optind = 1;
+ exit(ls_main(gargc, gargv));
+ }
+
execv(gargv[0], gargv);
_exit(1);
}