summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2005-05-03 07:01:24 +0000
committerDamien Miller <djm@cvs.openbsd.org>2005-05-03 07:01:24 +0000
commita25768b3e9daaa9aa29ecf239fc7f20f8406a85c (patch)
tree15a8544efd3fa4e137a68c9127d56afb2f1c0d3f
parent3cfd5c82fb4a8cd553756bb8354ce3b91327726d (diff)
setres[ug]id; ok claudio@
-rw-r--r--usr.sbin/bgpd/rde.c7
-rw-r--r--usr.sbin/bgpd/session.c6
2 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 28f83a64509..15a740cddfb 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.158 2005/04/28 13:54:45 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.159 2005/05/03 07:01:23 djm Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -148,10 +148,9 @@ rde_main(struct bgpd_config *config, struct peer *peer_l,
bgpd_process = PROC_RDE;
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();
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index b51e2328a7b..5969a5d7981 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.216 2005/03/30 11:23:15 henning Exp $ */
+/* $OpenBSD: session.c,v 1.217 2005/05/03 07:01:23 djm Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -211,8 +211,8 @@ session_main(struct bgpd_config *config, struct peer *cpeers,
fatalx("pfkey setup failed");
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();