summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/ospfe.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2005-05-02 02:26:36 +0000
committerDamien Miller <djm@cvs.openbsd.org>2005-05-02 02:26:36 +0000
commit2da213a15d6db3d71af4f7378f5a2f92854d3b02 (patch)
treeb3cf2d9ba043ebf2d2781c4346ffeaa5f1dc550a /usr.sbin/ospfd/ospfe.c
parent5504d0a8ea4485658c4a709aa5907dab61f8be31 (diff)
use setres[ug]id for privilege dropping; ok norby@
Diffstat (limited to 'usr.sbin/ospfd/ospfe.c')
-rw-r--r--usr.sbin/ospfd/ospfe.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index a3b5688417d..ca245f4bef9 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.17 2005/04/25 11:31:50 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.18 2005/05/02 02:26:35 djm Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -118,10 +118,9 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2],
ospfd_process = PROC_OSPF_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();