-/* $OpenBSD: ftpd.c,v 1.29 1997/01/02 21:33:33 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.30 1997/01/05 21:28:07 bitblt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
static void
end_login()
{
-
+ sigset_t allsigs;
+ sigfillset (&allsigs);
+ sigprocmask (SIG_BLOCK, &allsigs, NULL);
(void) seteuid((uid_t)0);
if (logged_in) {
logwtmp(ttyline, "", "");
FILE *fd;
static char homedir[MAXPATHLEN];
char rootdir[MAXPATHLEN];
+ sigset_t allsigs;
if (logged_in || askpasswd == 0) {
reply(503, "Login with USER first.");
reply(550, "Can't set uid.");
goto bad;
}
+ sigfillset(&allsigs);
+ sigprocmask(SIG_UNBLOCK,&allsigs,NULL);
/*
* Set home directory so that use of ~ (tilde) works correctly.
char *mode;
{
int on = 1, s, t, tries;
+ sigset_t allsigs;
if (data >= 0)
return (fdopen(data, mode));
+ sigfillset(&allsigs);
+ sigprocmask (SIG_BLOCK, &allsigs, NULL);
(void) seteuid((uid_t)0);
s = socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
sleep(tries);
}
(void) seteuid((uid_t)pw->pw_uid);
+ sigfillset(&allsigs);
+ sigprocmask (SIG_UNBLOCK, &allsigs, NULL);
+
#ifdef IP_TOS
on = IPTOS_THROUGHPUT;
if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0)
/* Return the real value of errno (close may change it) */
t = errno;
(void) seteuid((uid_t)pw->pw_uid);
+ sigfillset (&allsigs);
+ sigprocmask (SIG_UNBLOCK, &allsigs, NULL);
(void) close(s);
errno = t;
return (NULL);
dologout(status)
int status;
{
+ sigset_t allsigs;
+
transflag = 0;
if (logged_in) {
+ sigfillset(&allsigs);
+ sigprocmask(SIG_BLOCK, &allsigs, NULL);
(void) seteuid((uid_t)0);
logwtmp(ttyline, "", "");
if (doutmp)