Sort command-line options according to the mostly used style:

alphabetical order, lower and upper case of the same letter
stick together, lower case first.

MFC after:	2 weeks
This commit is contained in:
Yaroslav Tykhiy 2002-07-26 15:46:08 +00:00
parent a02377d3e2
commit 0e063efefb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100717
2 changed files with 99 additions and 99 deletions

View File

@ -40,12 +40,12 @@
.Nd Internet File Transfer Protocol server
.Sh SYNOPSIS
.Nm
.Op Fl 46ADEMORSUdro
.Op Fl 46AdDEMoOrRSU
.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
.Sh DESCRIPTION
The
.Nm
@ -81,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
@ -96,46 +104,6 @@ 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 M
Prevent anonymous users from creating directories.
.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 R
With this option set,
.Nm
will revert to historical behavior with regard to security checks on
user operations and restrictions on PORT requests.
Currently,
.Nm
will only honor PORT commands directed to unprivileged ports on the
remote user's host (which violates the FTP protocol specification but
closes some security holes).
.It Fl S
With this option set,
.Nm
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
@ -152,6 +120,45 @@ are not displayed by
by default, and may have to be enabled in
.Xr syslogd 8 Ns 's
configuration file.
.It Fl M
Prevent anonymous users from creating directories.
.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
will revert to historical behavior with regard to security checks on
user operations and restrictions on PORT requests.
Currently,
.Nm
will only honor PORT commands directed to unprivileged ports on the
remote user's host (which violates the FTP protocol specification but
closes some security holes).
.It Fl S
With this option set,
.Nm
logs all anonymous file downloads to the file
.Pa /var/log/ftpd
when this file exists.
.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
@ -160,20 +167,13 @@ 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
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.
.El
.Pp
The file

View File

@ -294,16 +294,34 @@ main(int argc, char *argv[], char **envp)
#endif /* OLD_SETPROCTITLE */
while ((ch = getopt(argc, argv, "AdlDESURrt:T:u:vMOoa:p:46")) != -1) {
while ((ch = getopt(argc, argv, "46a:AdDElMoOp: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;
@ -312,6 +330,22 @@ main(int argc, char *argv[], char **envp)
logging++; /* > 1 == extra logging */
break;
case 'M':
noguestmkd = 1;
break;
case 'o':
noretr = 1;
break;
case 'O':
noguestretr = 1;
break;
case 'p':
pid_file = optarg;
break;
case 'r':
readonly = 1;
break;
@ -324,28 +358,16 @@ main(int argc, char *argv[], char **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':
@ -359,36 +381,14 @@ main(int argc, char *argv[], char **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 'M':
noguestmkd = 1;
break;
case 'O':
noguestretr = 1;
break;
case 'o':
noretr = 1;
break;
default:
warnx("unknown flag -%c ignored", optopt);
break;