From 0160f1b3a26509627bd19523a72030b92cfe5126 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Tue, 18 Jan 2005 19:13:28 +0000 Subject: Also call sete{u,g}id() when dropping privs. From mpech@. ok millert@. --- usr.sbin/popa3d/pop_root.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.sbin/popa3d') 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; -- cgit v1.2.3