diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2005-05-02 02:26:36 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2005-05-02 02:26:36 +0000 |
commit | 2da213a15d6db3d71af4f7378f5a2f92854d3b02 (patch) | |
tree | b3cf2d9ba043ebf2d2781c4346ffeaa5f1dc550a /usr.sbin/ospfd/rde.c | |
parent | 5504d0a8ea4485658c4a709aa5907dab61f8be31 (diff) |
use setres[ug]id for privilege dropping; ok norby@
Diffstat (limited to 'usr.sbin/ospfd/rde.c')
-rw-r--r-- | usr.sbin/ospfd/rde.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index 7caa67025f1..b33ed1e5a6f 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.12 2005/04/12 09:54:59 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.13 2005/05/02 02:26:35 djm Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -110,10 +110,9 @@ rde(struct ospfd_conf *xconf, int pipe_parent2rde[2], int pipe_ospfe2rde[2], ospfd_process = PROC_RDE_ENGINE; if (setgroups(1, &pw->pw_gid) || - setegid(pw->pw_gid) || setgid(pw->pw_gid) || - seteuid(pw->pw_uid) || setuid(pw->pw_uid)) { + setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || + setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("can't drop privileges"); - } endpwent(); |