diff options
author | davidn <davidn@FreeBSD.org> | 1997-04-26 12:12:10 +0000 |
---|---|---|
committer | davidn <davidn@FreeBSD.org> | 1997-04-26 12:12:10 +0000 |
commit | a1afe7148074c37601ddb27c0db42c7e7e29ac69 (patch) | |
tree | 91a142b078eba657ed76e534ddca5851a3f61c20 /libexec/ftpd/ftpd.c | |
parent | 6323aa10bffe459912ba8b2f8592c7ac4ffd8705 (diff) | |
download | FreeBSD-src-a1afe7148074c37601ddb27c0db42c7e7e29ac69.zip FreeBSD-src-a1afe7148074c37601ddb27c0db42c7e7e29ac69.tar.gz |
Adds optional "internal ls" support for ftpd, by collecting
modules from src/bin/ls, and handling exec(_PATH_LS,..) as a
special case, very useful in an environment where many users
are given chroot access. "~/etc/{s}pwd.db" files are still
needed if uid/gid->user/group translation is desired.
To enable this it must be compiled with the make variable
FTP_INTERNAL_LS defined, either in /etc/make.conf or the
environment.
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r-- | libexec/ftpd/ftpd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 36fbbab..8c6578a 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ftpd.c,v 1.34 1997/03/28 15:48:09 imp Exp $ + * $Id: ftpd.c,v 1.35 1997/04/23 04:56:39 davidn Exp $ */ #if 0 @@ -102,7 +102,12 @@ static char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94"; #include <varargs.h> #endif +#ifdef INTERNAL_LS +static char version[] = "Version 6.00LS"; +#undef main +#else static char version[] = "Version 6.00"; +#endif extern off_t restart_point; extern char cbuf[]; @@ -1388,7 +1393,7 @@ statfilecmd(filename) int c; char line[LINE_MAX]; - (void)snprintf(line, sizeof(line), "/bin/ls -lgA %s", filename); + (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename); fin = ftpd_popen(line, "r"); lreply(211, "status of %s:", filename); while ((c = getc(fin)) != EOF) { @@ -1899,7 +1904,7 @@ send_file_list(whichf) */ if (dirname[0] == '-' && *dirlist == NULL && transflag == 0) { - retrieve("/bin/ls %s", dirname); + retrieve(_PATH_LS " %s", dirname); goto out; } perror_reply(550, whichf); |