summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2005-02-28 12:42:55 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2005-02-28 12:42:55 +0000
commit241c9362712b6bc93ca97cc621033c7a6e363806 (patch)
tree48753d62e3b81a66209fd3ba2ce754ec52becfc2 /libexec
parent677cde5a3aba1b0b07c733d5e5b91231f9c408f5 (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.812
-rw-r--r--libexec/ftpd/ftpd.c29
-rw-r--r--libexec/ftpd/popen.c2
3 files changed, 23 insertions, 20 deletions
diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8
index 025fc3660571..aed7d5d57a58 100644
--- a/libexec/ftpd/ftpd.8
+++ b/libexec/ftpd/ftpd.8
@@ -546,6 +546,12 @@ Default place for session logs.
.Xr login.conf 5 ,
.Xr inetd 8 ,
.Xr syslogd 8
+.Sh HISTORY
+The
+.Nm
+utility appeared in
+.Bx 4.2 .
+IPv6 support was added in WIDE Hydrangea IPv6 stack kit.
.Sh BUGS
The server must run as the super-user
to create sockets with privileged port numbers.
@@ -555,9 +561,3 @@ the super-user only when binding addresses to sockets.
The
possible security holes have been extensively
scrutinized, but are possibly incomplete.
-.Sh HISTORY
-The
-.Nm
-utility appeared in
-.Bx 4.2 .
-IPv6 support was added in WIDE Hydrangea IPv6 stack kit.
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 5f0f9a1d86bf..888263990f4d 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -139,12 +139,12 @@ int stru; /* avoid C keyword */
int mode;
int usedefault = 1; /* for data transfers */
int pdata = -1; /* for passive mode */
-int readonly=0; /* Server is in readonly mode. */
-int noepsv=0; /* EPSV command is disabled. */
-int noretr=0; /* RETR command is disabled. */
-int noguestretr=0; /* RETR command is disabled for anon users. */
-int noguestmkd=0; /* MKD command is disabled for anon users. */
-int noguestmod=1; /* anon users may not modify existing files. */
+int readonly = 0; /* Server is in readonly mode. */
+int noepsv = 0; /* EPSV command is disabled. */
+int noretr = 0; /* RETR command is disabled. */
+int noguestretr = 0; /* RETR command is disabled for anon users. */
+int noguestmkd = 0; /* MKD command is disabled for anon users. */
+int noguestmod = 1; /* anon users may not modify existing files. */
off_t file_size;
off_t byte_count;
@@ -174,17 +174,17 @@ static struct ftphost {
char remotehost[NI_MAXHOST];
char *ident = NULL;
-static char ttyline[20];
-char *tty = ttyline; /* for klogin */
+static char ttyline[20];
+char *tty = ttyline; /* for klogin */
#ifdef USE_PAM
static int auth_pam(struct passwd**, const char*);
-pam_handle_t *pamh = NULL;
+pam_handle_t *pamh = NULL;
#endif
-static struct opie opiedata;
-static char opieprompt[OPIE_CHALLENGE_MAX+1];
-static int pwok;
+static struct opie opiedata;
+static char opieprompt[OPIE_CHALLENGE_MAX+1];
+static int pwok;
char *pid_file = NULL;
@@ -239,7 +239,7 @@ static int transflag; /* NB: for debugging only */
#ifdef VIRTUAL_HOSTING
static void inithosts(void);
-static void selecthost(union sockunion *);
+static void selecthost(union sockunion *);
#endif
static void ack(char *);
static void sigurg(int);
@@ -939,6 +939,9 @@ sgetsave(char *s)
* Save the result of a getpwnam. Used for USER command, since
* the data returned must not be clobbered by any other command
* (e.g., globbing).
+ * NB: The data returned by sgetpwnam() will remain valid until
+ * the next call to this function. Its difference from getpwnam()
+ * is that sgetpwnam() is known to be called from ftpd code only.
*/
static struct passwd *
sgetpwnam(char *name)
diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c
index abc4ec2cd5a2..05b6d6f62ebc 100644
--- a/libexec/ftpd/popen.c
+++ b/libexec/ftpd/popen.c
@@ -84,7 +84,7 @@ ftpd_popen(char *program, char *type)
if (!pids) {
if ((fds = getdtablesize()) <= 0)
return (NULL);
- if ((pids = (int *)malloc((u_int)(fds * sizeof(int)))) == NULL)
+ if ((pids = malloc(fds * sizeof(int))) == NULL)
return (NULL);
memset(pids, 0, fds * sizeof(int));
}