summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2002-08-09 15:36:26 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2002-08-09 15:36:26 +0000
commit82e47923d6357389155814e167d38c6a5490b4f6 (patch)
treef06d57ff951292b65a72934bd7368969caf74910 /libexec
parent3976147b356b54b49797fefc30de5f043863d5e6 (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.8108
-rw-r--r--libexec/ftpd/ftpd.c80
2 files changed, 100 insertions, 88 deletions
diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8
index 43544c8c30c4..efe258905b1f 100644
--- a/libexec/ftpd/ftpd.8
+++ b/libexec/ftpd/ftpd.8
@@ -40,12 +40,13 @@
.Nd Internet File Transfer Protocol server
.Sh SYNOPSIS
.Nm
-.Op Fl 46ADEORSUdro
+.Op Fl 46AdDEoOrRSUv
.Op Fl l Op Fl l
-.Op Fl T Ar maxtimeout
.Op Fl a Ar address
.Op Fl p Ar file
.Op Fl t Ar timeout
+.Op Fl T Ar maxtimeout
+.Op Fl u Ar umask
.Sh DESCRIPTION
.Nm Ftpd
is the
@@ -80,8 +81,16 @@ When
is specified, accept connections via
.Dv AF_INET6
socket.
+.It Fl a
+When
+.Fl D
+is specified, accept connections only on the specified
+.Ar address .
.It Fl A
Allow only anonymous ftp access.
+.It Fl d
+Debugging information is written to the syslog using
+.Dv LOG_FTP .
.It Fl D
With this option set,
.Nm
@@ -95,12 +104,39 @@ and is thus useful on busy servers to reduce load.
.It Fl E
Disable the EPSV command.
This is useful for servers behind older firewalls.
+.It Fl l
+Each successful and failed
+.Xr ftp 1
+session is logged using syslog with a facility of
+.Dv LOG_FTP .
+If this option is specified twice, the retrieve (get), store (put), append,
+delete, make directory, remove directory and rename operations and
+their filename arguments are also logged.
+Note:
+.Dv LOG_FTP
+messages
+are not displayed by
+.Xr syslogd 8
+by default, and may have to be enabled in
+.Xr syslogd 8 Ns 's
+configuration file.
+.It Fl o
+Put server in write-only mode.
+RETR is disabled, preventing downloads.
.It Fl O
Put server in write-only mode for anonymous users only.
RETR is disabled for anonymous users, preventing anonymous downloads.
This has no effect if
.Fl o
is also specified.
+.It Fl p
+When
+.Fl D
+is specified, write the daemon's process ID to
+.Ar file .
+.It Fl r
+Put server in read-only mode.
+All commands which may modify the local filesystem are disabled.
.It Fl R
With this option set,
.Nm
@@ -117,38 +153,10 @@ With this option set,
logs all anonymous file downloads to the file
.Pa /var/log/ftpd
when this file exists.
-.It Fl U
-In previous versions of
-.Nm ,
-when a passive mode client requested a data connection to the server,
-the server would use data ports in the range 1024..4999. Now, by default,
-the server will use data ports in the range 49152..65535. Specifying this
-option will revert to the old behavior.
-.It Fl d
-Debugging information is written to the syslog using
-.Dv LOG_FTP .
-.It Fl r
-Put server in read-only mode.
-All commands which may modify the local filesystem are disabled.
-.It Fl o
-Put server in write-only mode.
-RETR is disabled, preventing downloads.
-.It Fl l
-Each successful and failed
-.Xr ftp 1
-session is logged using syslog with a facility of
-.Dv LOG_FTP .
-If this option is specified twice, the retrieve (get), store (put), append,
-delete, make directory, remove directory and rename operations and
-their filename arguments are also logged.
-Note:
-.Dv LOG_FTP
-messages
-are not displayed by
-.Xr syslogd 8
-by default, and may have to be enabled in
-.Xr syslogd 8 Ns 's
-configuration file.
+.It Fl t
+The inactivity timeout period is set to
+.Ar timeout
+seconds (the default is 15 minutes).
.It Fl T
A client may also request a different timeout period;
the maximum period allowed may be set to
@@ -157,20 +165,23 @@ seconds with the
.Fl T
option.
The default limit is 2 hours.
-.It Fl a
-When
-.Fl D
-is specified, accept connections only on the specified
-.Ar address .
-.It Fl p
-When
-.Fl D
-is specified, write the daemon's process ID to
-.Ar file .
-.It Fl t
-The inactivity timeout period is set to
-.Ar timeout
-seconds (the default is 15 minutes).
+.It Fl u
+The default file creation mode mask is set to
+.Ar umask ,
+which is expected to be an octal numeric value.
+Refer to
+.Xr umask 2
+for details.
+.It Fl U
+In previous versions of
+.Nm ,
+when a passive mode client requested a data connection to the server,
+the server would use data ports in the range 1024..4999. Now, by default,
+the server will use data ports in the range 49152..65535. Specifying this
+option will revert to the old behavior.
+.It Fl v
+A synonym for
+.Fl d .
.El
.Pp
The file
@@ -479,6 +490,7 @@ Log file for anonymous transfers.
.Sh SEE ALSO
.Xr ftp 1 ,
.Xr key 1 ,
+.Xr umask 2 ,
.Xr getusershell 3 ,
.Xr login.conf 5 ,
.Xr inetd 8 ,
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index fc31cdec2bb3..d41dc22873ef 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -302,16 +302,34 @@ main(argc, argv, envp)
#endif /* OLD_SETPROCTITLE */
- while ((ch = getopt(argc, argv, "AdlDESURrt:T:u:vOoa:p:46")) != -1) {
+ while ((ch = getopt(argc, argv, "46a:AdDEloOp:rRSt:T:u:Uv")) != -1) {
switch (ch) {
- case 'D':
- daemon_mode++;
+ case '4':
+ enable_v4 = 1;
+ if (family == AF_UNSPEC)
+ family = AF_INET;
+ break;
+
+ case '6':
+ family = AF_INET6;
+ break;
+
+ case 'a':
+ bindname = optarg;
+ break;
+
+ case 'A':
+ anon_only = 1;
break;
case 'd':
ftpdebug++;
break;
+ case 'D':
+ daemon_mode++;
+ break;
+
case 'E':
noepsv = 1;
break;
@@ -320,6 +338,18 @@ main(argc, argv, envp)
logging++; /* > 1 == extra logging */
break;
+ case 'o':
+ noretr = 1;
+ break;
+
+ case 'O':
+ noguestretr = 1;
+ break;
+
+ case 'p':
+ pid_file = optarg;
+ break;
+
case 'r':
readonly = 1;
break;
@@ -332,28 +362,16 @@ main(argc, argv, envp)
stats++;
break;
- case 'T':
- maxtimeout = atoi(optarg);
- if (timeout > maxtimeout)
- timeout = maxtimeout;
- break;
-
case 't':
timeout = atoi(optarg);
if (maxtimeout < timeout)
maxtimeout = timeout;
break;
- case 'U':
- restricted_data_ports = 0;
- break;
-
- case 'a':
- bindname = optarg;
- break;
-
- case 'p':
- pid_file = optarg;
+ case 'T':
+ maxtimeout = atoi(optarg);
+ if (timeout > maxtimeout)
+ timeout = maxtimeout;
break;
case 'u':
@@ -367,30 +385,12 @@ main(argc, argv, envp)
defumask = val;
break;
}
- case 'A':
- anon_only = 1;
+ case 'U':
+ restricted_data_ports = 0;
break;
case 'v':
- ftpdebug = 1;
- break;
-
- case '4':
- enable_v4 = 1;
- if (family == AF_UNSPEC)
- family = AF_INET;
- break;
-
- case '6':
- family = AF_INET6;
- break;
-
- case 'O':
- noguestretr = 1;
- break;
-
- case 'o':
- noretr = 1;
+ ftpdebug++;
break;
default: