+2001-06-08 Mitchell Berger <mitchb@mit.edu>
+
+ * pathnames.h: _PATH_FTPUSERS renamed to _PATH_FTPUSERS_DEFAULT.
+
+ * ftpd.c: Added '-U filename' option to allow specification of
+ an ftpusers file other than the default.
+
+ * ftpd.M: Documented the new -U option.
+
2001-06-06 Ezra Peisach <epeisach@mit.edu>
* ftpcmd.y: Include "ftpd_var.h" and remove prototype for reply()
[\fB\-a \fP|\fB -A\fP] [\fB\-c\fP] [\fB\-C\fP] [\fB\-d\fP] [\fB\-l\fP]
[\fB\-t\fP \fItimeout\fP] [\fB\-T\fP \fImaxtimeout\fP]
[\fB\-p\fP \fIport\fP] [\fB\-u\fP \fIumask\fP]
+[\fB\-U\fP \fIftpusers-file\fP]
[\fB\-r\fP \fIrealm-file\fP] [\fB\-s\fP \fIsrvtab\fP]
[\fB\-w\fP[\fBip\fP|\fImaxhostlen\fP[\fB,\fP[\fBno\fP]\fBstriplocal\fP]]]
.SH DESCRIPTION
\fB\-u\fP \fIumask\fP
Sets the umask for the ftpd process. The default value is normally 027.
.TP
+\fB\-U\fP \fIftpusers-file\fP
+Sets the full path and name of the
+.I ftpusers
+file to use. The default value is normally
+.IR /etc/ftpusers .
+.TP
\fB\-r\fP \fIrealm-file\fP
Sets the name of the
.I krb.conf
#endif
extern char *mktemp ();
+char *ftpusers;
#include <k5-util.h>
{
int addrlen, on = 1, tos, port = -1;
char *cp;
+ ftpusers = _PATH_FTPUSERS_DEFAULT;
#ifdef KRB5_KRB4_COMPAT
keyfile = KEYFILE;
goto nextopt;
}
+ case 'U':
+ if (*++cp != '\0')
+ ftpusers = cp;
+ else if (argc > 1) {
+ argc--, argv++;
+ ftpusers = *argv;
+ }
+ else
+ fprintf(stderr, "ftpd: -U expects argument\n");
+ goto nextopt;
+
case 'w':
{
char *optarg;
* Sets global passwd pointer pw if named account exists and is acceptable;
* sets askpasswd if a PASS command is expected. If logged in previously,
* need to reset state. If name is "ftp" or "anonymous", the name is not in
- * _PATH_FTPUSERS, and ftp account exists, set guest and pw, then just return.
+ * ftpusers, and ftp account exists, set guest and pw, then just return.
* If account doesn't exist, ask for passwd anyway. Otherwise, check user
* requesting login privileges. Disallow anyone who does not have a standard
* shell as returned by getusershell(). Disallow anyone mentioned in the file
- * _PATH_FTPUSERS to allow people such as root and uucp to be avoided, except
+ * ftpusers to allow people such as root and uucp to be avoided, except
* for users whose names are followed by whitespace and then the keyword
* "restrict." Restricted users are allowed to login, but a chroot() is
* done to their home directory.
}
/*
- * Check if a user is in the file _PATH_FTPUSERS.
+ * Check if a user is in the file ftpusers.
* Return 1 if they are (a disallowed user), -1 if their username
* is followed by "restrict." (a restricted user). Otherwise return 0.
*/
register char *p;
char line[FTP_BUFSIZ];
- if ((fd = fopen(_PATH_FTPUSERS, "r")) != NULL) {
+ if ((fd = fopen(ftpusers, "r")) != NULL) {
while (fgets(line, sizeof(line), fd) != NULL) {
if ((p = strchr(line, '\n')) != NULL) {
*p = '\0';