diff -dru troll-ftpd-1.28/Makefile troll-ftpd-1.28-fjo/Makefile --- troll-ftpd-1.28/Makefile Tue Feb 5 12:51:33 2002 +++ troll-ftpd-1.28-fjo/Makefile Fri Apr 5 21:29:30 2002 @@ -1,9 +1,9 @@ # $Id: Makefile,v 1.17 1999/06/11 05:09:44 agulbra Exp $ CC = gcc -CFLAGS = -g -W -Wall # -Werror +CFLAGS = -Os -pipe -g -W -Wall # -Werror VERSION = 1.28 -BINDIR = /usr/local/sbin -MANDIR = /usr/local/man/man8 +BINDIR = /usr/sbin +MANDIR = /usr/man/man8 all: mkusers ftpd mrtginfo @@ -19,9 +19,9 @@ $(CC) $(CFLAGS) -o mrtginfo mrtginfo.c daemons.o install: ftpd mkusers - -mkdir -p /var/adm/ftp - chown root.root /var/adm/ftp - chmod 755 /var/adm/ftp + -mkdir -p /etc/ftp + chown root.root /etc/ftp + chmod 755 /etc/ftp ./mkusers cp mkusers ftpd $(BINDIR) cp ftpd.8 $(MANDIR) diff -dru troll-ftpd-1.28/ftpd.8 troll-ftpd-1.28-fjo/ftpd.8 --- troll-ftpd-1.28/ftpd.8 Tue Feb 5 12:51:33 2002 +++ troll-ftpd-1.28-fjo/ftpd.8 Fri Apr 5 21:27:05 2002 @@ -155,7 +155,7 @@ .PP 2. The user connects to an IP address which resolves to the name of a directory in -.I /var/adm/ftp +.I /etc/ftp (or a symlink in that directory to a real directory), and there is an account called "ftp" (which does not need to have a valid home directory). See @@ -182,9 +182,9 @@ The internal .B ls (see below) uses two files, -.I /var/adm/ftp/users +.I /etc/ftp/users and -.IR /var/adm/ftp/groups , +.IR /etc/ftp/groups , to look up file owner and group names quickly. These files are written by .B mkusers @@ -308,7 +308,7 @@ 2. Create a directory as described in .B Anonymous FTP and make a symlink called -.I /var/adm/ftp/ftp.example.com +.I /etc/ftp/ftp.example.com which points to this directory. .PP 3. Make sure your kernel has support for IP aliases. @@ -343,7 +343,7 @@ try. .PP First, symlink -.I /var/adm/ftp/localhost +.I /etc/ftp/localhost to some directory and say "ftp localhost". If that doesn't log you in, the problem is with .B ftpd. @@ -380,9 +380,9 @@ .B -p options are used .PP -.I /var/adm/ftp/users +.I /etc/ftp/users and -.I /var/adm/ftp/groups +.I /etc/ftp/groups are used to list the names of users and groups by the LIST command, and are updated by .BR mkusers (8). @@ -390,7 +390,7 @@ they are mostly unallocated space. Use "ls -s" to find the true size of the files (in kbytes). .PP -.I /var/adm/ftp/[hostname] +.I /etc/ftp/[hostname] is the base directory for the [hostname] virtual ftp server, or a symbolic link to its base directory. .B Ftpd diff -dru troll-ftpd-1.28/ftpd.c troll-ftpd-1.28-fjo/ftpd.c --- troll-ftpd-1.28/ftpd.c Tue Feb 5 12:51:33 2002 +++ troll-ftpd-1.28-fjo/ftpd.c Fri Apr 26 00:29:13 2002 @@ -412,9 +412,10 @@ dormd( arg ); else addreply( 550, "No directory name." ); - } else if ( !strcasecmp( cmd, "list" ) || - !strcasecmp( cmd, "nlst" ) ) { + } else if ( !strcasecmp( cmd, "list" ) ) { donlist( (arg && *arg ) ? arg : "-l" ); + } else if ( !strcasecmp( cmd, "nlst" ) ) { + donlist( "-a" ); } else if ( !strcasecmp( cmd, "type" ) ) { dotype( arg ); } else if ( !strcasecmp( cmd, "mode" ) ) { @@ -1519,7 +1520,7 @@ openlog( "in.ftpd", LOG_CONS | LOG_PID, LOG_LOCAL2 ); - /* mmap in /var/adm/ftp/users and /var/adm/ftp/groups, for use by + /* mmap in /etc/ftp/users and /var/adm/ftp/groups, for use by ls. do it before the chroot if ls is supposed to show the same stuff. */ getnames(); @@ -1694,7 +1695,7 @@ if ( he && he->h_name ) { char name[PATH_MAX]; - if ( snprintf( name, PATH_MAX, "/var/adm/ftp/%s/.", he->h_name ) < 0 ){ + if ( snprintf( name, PATH_MAX, "/etc/ftp/%s/.", he->h_name ) < 0 ){ syslog( LOG_ERR, "host name far too long for %s", inet_ntoa( ctrlconn.sin_addr ) ); exit( 15 ); diff -dru troll-ftpd-1.28/ls.c troll-ftpd-1.28-fjo/ls.c --- troll-ftpd-1.28/ls.c Tue Feb 5 12:51:33 2002 +++ troll-ftpd-1.28-fjo/ls.c Fri Apr 5 21:27:05 2002 @@ -88,7 +88,7 @@ /* uid_t can have 65536 values on linux */ - f = open( "/var/adm/ftp/users", O_RDONLY ); + f = open( "/etc/ftp/users", O_RDONLY ); if ( f >= 0 ) { users = mmap( 0, (size_t) 9 * 65536, PROT_READ, MAP_FILE | MAP_SHARED, f, 0 ); @@ -97,7 +97,7 @@ close( f ); } } - f = open( "/var/adm/ftp/groups", O_RDONLY ); + f = open( "/etc/ftp/groups", O_RDONLY ); if ( f >= 0 ) { groups = mmap( 0, ( size_t ) 9 * 65536, PROT_READ, MAP_FILE | MAP_SHARED, f, 0 ); diff -dru troll-ftpd-1.28/mkusers.8 troll-ftpd-1.28-fjo/mkusers.8 --- troll-ftpd-1.28/mkusers.8 Tue Feb 5 12:51:33 2002 +++ troll-ftpd-1.28-fjo/mkusers.8 Fri Apr 5 21:27:05 2002 @@ -48,12 +48,12 @@ .I /etc/yp.conf are common examples. .PP -.I /var/adm/ftp/users +.I /etc/ftp/users is used to store user names in an efficient format. Each user name is stored as a null-terminated string at offset (9*uid). (If user names are longer than 8 characters, they are truncated.) .PP -.I /var/adm/ftp/groups +.I /etc/ftp/groups is used to store groups names in an efficient format. Each group name is stored as a null-terminated string at offset (9*gid). (If group names are longer than 8 characters, they are truncated.) @@ -62,9 +62,9 @@ takes care to use .BR seek (3) so that -.I /var/adm/ftp/users +.I /etc/ftp/users and -.I /var/adm/ftp/groups +.I /etc/ftp/groups are sparse if possible. Use "ls -s" to find the true size of these files (in kbytes) rather than "ls -l". diff -dru troll-ftpd-1.28/mkusers.c troll-ftpd-1.28-fjo/mkusers.c --- troll-ftpd-1.28/mkusers.c Tue Feb 5 12:51:33 2002 +++ troll-ftpd-1.28-fjo/mkusers.c Fri Apr 5 21:27:05 2002 @@ -11,7 +11,7 @@ int f; char dummy[17]; - f = open("/var/adm/ftp/users", O_WRONLY|O_CREAT|O_TRUNC, 0644); + f = open("/etc/ftp/users", O_WRONLY|O_CREAT|O_TRUNC, 0644); if (f>=0) { struct passwd * pw; while((pw = getpwent()) != NULL) { @@ -24,7 +24,7 @@ exit( 1 ); } - f = open("/var/adm/ftp/groups", O_WRONLY|O_CREAT|O_TRUNC, 0644); + f = open("/etc/ftp/groups", O_WRONLY|O_CREAT|O_TRUNC, 0644); if (f>=0) { struct group * gr; while((gr = getgrent()) != NULL) {