From 11df7e3f6f1ddc12cf84d3ebc989f2cae7457e6d Mon Sep 17 00:00:00 2001 From: yar Date: Fri, 26 Jul 2002 15:46:08 +0000 Subject: 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 --- libexec/ftpd/ftpd.8 | 96 ++++++++++++++++++++++++++--------------------------- libexec/ftpd/ftpd.c | 86 +++++++++++++++++++++++------------------------ 2 files changed, 91 insertions(+), 91 deletions(-) (limited to 'libexec') diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index da6adf2..b7ae30c 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -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,14 +104,41 @@ 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 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 @@ -120,38 +155,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 @@ -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 diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 7efa29a..50bbc87 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -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; -- cgit v1.1