diff options
author | 1997-06-29 07:35:42 +0000 | |
---|---|---|
committer | 1997-06-29 07:35:42 +0000 | |
commit | 1d5555bfc96211fce211379c59a8111b6af70419 (patch) | |
tree | 8a04ed1a54f721718a55952b2e1f0c2b43142113 | |
parent | Make sleep handle fractions of a second. Why not? (diff) | |
download | wireguard-openbsd-1d5555bfc96211fce211379c59a8111b6af70419.tar.xz wireguard-openbsd-1d5555bfc96211fce211379c59a8111b6af70419.zip |
partial Wall
-rw-r--r-- | libexec/ftpd/extern.h | 4 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 26 | ||||
-rw-r--r-- | libexec/ftpd/logwtmp.c | 2 | ||||
-rw-r--r-- | libexec/ftpd/popen.c | 6 |
4 files changed, 22 insertions, 16 deletions
diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h index 23dbb82fbc0..6fffb87f5f2 100644 --- a/libexec/ftpd/extern.h +++ b/libexec/ftpd/extern.h @@ -44,7 +44,7 @@ void fatal __P((char *)); int ftpd_pclose __P((FILE *)); FILE *ftpd_popen __P((char *, char *)); char *getline __P((char *, int, FILE *)); -void logwtmp __P((char *, char *, char *)); +void ftpdlogwtmp __P((char *, char *, char *)); void lreply __P((int, const char *, ...)); void makedir __P((char *)); void nack __P((char *)); @@ -66,3 +66,5 @@ void upper __P((char *)); void user __P((char *)); void yyerror __P((char *)); void toolong __P((int)); + +int yyparse __P((void)); diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index ec1356ccfb5..16ae0ae6de4 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.38 1997/06/21 12:44:41 deraadt Exp $ */ +/* $OpenBSD: ftpd.c,v 1.39 1997/06/29 07:35:44 deraadt Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -86,12 +86,17 @@ static char rcsid[] = "$NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $" #include <time.h> #include <vis.h> #include <unistd.h> +#include <util.h> #include <utmp.h> #if defined(TCPWRAPPERS) #include <tcpd.h> #endif /* TCPWRAPPERS */ +#if defined(SKEY) +#include <skey.h> +#endif + #include "pathnames.h" #include "extern.h" @@ -619,7 +624,7 @@ user(name) return; } - if (pw = sgetpwnam(name)) { + if ((pw = sgetpwnam(name))) { if ((shell = pw->pw_shell) == NULL || *shell == 0) shell = _PATH_BSHELL; while ((cp = getusershell()) != NULL) @@ -701,7 +706,7 @@ end_login() sigprocmask (SIG_BLOCK, &allsigs, NULL); (void) seteuid((uid_t)0); if (logged_in) { - logwtmp(ttyline, "", ""); + ftpdlogwtmp(ttyline, "", ""); if (doutmp) logout(utmp.ut_line); } @@ -786,7 +791,7 @@ skip: (void) initgroups(pw->pw_name, pw->pw_gid); /* open wtmp before chroot */ - logwtmp(ttyline, pw->pw_name, remotehost); + ftpdlogwtmp(ttyline, pw->pw_name, remotehost); /* open utmp before chroot */ if (doutmp) { @@ -885,8 +890,8 @@ skip: #ifdef HASSETPROCTITLE snprintf(proctitle, sizeof(proctitle), "%s: anonymous/%.*s", remotehost, - sizeof(proctitle) - sizeof(remotehost) - - sizeof(": anonymous/"), passwd); + (int)(sizeof(proctitle) - sizeof(remotehost) - + sizeof(": anonymous/")), passwd); setproctitle(proctitle); #endif /* HASSETPROCTITLE */ if (logging) @@ -1605,7 +1610,7 @@ yyerror(s) { char *cp; - if (cp = strchr(cbuf,'\n')) + if ((cp = strchr(cbuf,'\n'))) *cp = '\0'; reply(500, "'%s': command not understood.", cbuf); } @@ -1759,7 +1764,7 @@ dologout(status) sigfillset(&allsigs); sigprocmask(SIG_BLOCK, &allsigs, NULL); (void) seteuid((uid_t)0); - logwtmp(ttyline, "", ""); + ftpdlogwtmp(ttyline, "", ""); if (doutmp) logout(utmp.ut_line); #if defined(KERBEROS) @@ -1811,7 +1816,6 @@ void passive() { int len, on; - u_short port; char *p, *a; if (pw == NULL) { @@ -1958,7 +1962,7 @@ send_file_list(whichf) transflag = 0; goto out; } - while (dirname = *dirlist++) { + while ((dirname = *dirlist++)) { if (stat(dirname, &st) < 0) { /* * If user typed "ls -l", etc, and the client @@ -2091,7 +2095,7 @@ logxfer(name, size, start) snprintf(buf, sizeof(buf), "%.24s %d %s %qd %s %c %s %c %c %s ftp %d %s %s\n", ctime(&now), now - start + (now == start), - vremotehost, size, vpath, + vremotehost, (long long) size, vpath, ((type == TYPE_A) ? 'a' : 'b'), "*" /* none yet */, 'o', ((guest) ? 'a' : 'r'), vpw, 0 /* none yet */, diff --git a/libexec/ftpd/logwtmp.c b/libexec/ftpd/logwtmp.c index 5ecc443ac75..1b3416cd791 100644 --- a/libexec/ftpd/logwtmp.c +++ b/libexec/ftpd/logwtmp.c @@ -61,7 +61,7 @@ static int fd = -1; * after login, but before logout). */ void -logwtmp(line, name, host) +ftpdlogwtmp(line, name, host) char *line, *name, *host; { struct utmp ut; diff --git a/libexec/ftpd/popen.c b/libexec/ftpd/popen.c index 1d67f02d9f4..f7f89ceaa74 100644 --- a/libexec/ftpd/popen.c +++ b/libexec/ftpd/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.8 1996/12/07 10:52:06 bitblt Exp $ */ +/* $OpenBSD: popen.c,v 1.9 1997/06/29 07:35:48 deraadt Exp $ */ /* $NetBSD: popen.c,v 1.5 1995/04/11 02:45:00 cgd Exp $ */ /* @@ -80,7 +80,7 @@ ftpd_popen(program, type) int argc, gargc, pdes[2], pid; char **pop, *argv[MAX_ARGV], *gargv[MAX_GARGV]; - if (*type != 'r' && *type != 'w' || type[1]) + if ((*type != 'r' && *type != 'w') || type[1]) return (NULL); if (!pids) { @@ -170,7 +170,7 @@ int ftpd_pclose(iop) FILE *iop; { - int fdes, omask, status; + int fdes, status; pid_t pid; sigset_t sigset, osigset; |