summaryrefslogtreecommitdiff
path: root/usr.sbin/popa3d/pop_root.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2005-01-18 19:13:28 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2005-01-18 19:13:28 +0000
commit0160f1b3a26509627bd19523a72030b92cfe5126 (patch)
treead1731ac46a53e330d8d6b8eb53623a8ae586098 /usr.sbin/popa3d/pop_root.c
parentd365357b50213d57af3c85f846c517ea29d38ce2 (diff)
Also call sete{u,g}id() when dropping privs. From mpech@. ok millert@.
Diffstat (limited to 'usr.sbin/popa3d/pop_root.c')
-rw-r--r--usr.sbin/popa3d/pop_root.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/popa3d/pop_root.c b/usr.sbin/popa3d/pop_root.c
index 14f815e8df4..a5db754f84a 100644
--- a/usr.sbin/popa3d/pop_root.c
+++ b/usr.sbin/popa3d/pop_root.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pop_root.c,v 1.3 2003/05/12 19:28:22 camield Exp $ */
+/* $OpenBSD: pop_root.c,v 1.4 2005/01/18 19:13:27 otto Exp $ */
/*
* Main daemon code: invokes the actual POP handling routines. Most calls
@@ -58,7 +58,9 @@ static int set_user(struct passwd *pw)
groups[0] = groups[1] = pw->pw_gid;
if (setgroups(1, groups)) return log_error("setgroups");
+ if (setegid(pw->pw_gid)) return log_error("setegid");
if (setgid(pw->pw_gid)) return log_error("setgid");
+ if (seteuid(pw->pw_uid)) return log_error("seteuid");
if (setuid(pw->pw_uid)) return log_error("setuid");
return 0;