summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2003-12-09 07:22:11 +0000
committerBob Beck <beck@cvs.openbsd.org>2003-12-09 07:22:11 +0000
commit0f4a0bc0835143abaf53d8dce692ef65d43f9394 (patch)
tree9b2e65eae41231890202e692d5d62195d468684f /libexec
parentd8e5a0a2bc257e26c745996feb32f3e9405a92f2 (diff)
fix PR 3596 by making root create the socket, ok millert@
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index d11468d3f31..dba6c538ba3 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.149 2003/11/20 12:32:34 jmc Exp $ */
+/* $OpenBSD: ftpd.c,v 1.150 2003/12/09 07:22:10 beck Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -70,7 +70,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#else
static const char rcsid[] =
- "$OpenBSD: ftpd.c,v 1.149 2003/11/20 12:32:34 jmc Exp $";
+ "$OpenBSD: ftpd.c,v 1.150 2003/12/09 07:22:10 beck Exp $";
#endif
#endif /* not lint */
@@ -1290,7 +1290,9 @@ getdatasock(char *mode)
if (data >= 0)
return (fdopen(data, mode));
sigprocmask (SIG_BLOCK, &allsigs, NULL);
+ (void) seteuid(0);
s = socket(ctrl_addr.su_family, SOCK_STREAM, 0);
+ (void) seteuid((uid_t)pw->pw_uid);
if (s < 0)
goto bad;
if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,