summaryrefslogtreecommitdiff
path: root/libexec/identd/identd.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-12-22 03:41:25 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-12-22 03:41:25 +0000
commit29b942ca271faf57cf22f4d77c6198d3d9a18795 (patch)
treee78e01431d74ee7d5e7f89285861a5ce132897ca /libexec/identd/identd.c
parent6d199d4d37f161aa59adabfe73b2ce615367fedf (diff)
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'libexec/identd/identd.c')
-rw-r--r--libexec/identd/identd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libexec/identd/identd.c b/libexec/identd/identd.c
index 20e0d3934f5..fee2e467576 100644
--- a/libexec/identd/identd.c
+++ b/libexec/identd/identd.c
@@ -1,5 +1,5 @@
/*
-** $Id: identd.c,v 1.2 1996/07/25 09:50:02 deraadt Exp $
+** $Id: identd.c,v 1.3 1996/12/22 03:41:14 tholo Exp $
**
** identd.c A TCP/IP link identification protocol server
**
@@ -450,13 +450,19 @@ int main(argc,argv)
ERROR("main: listen");
}
- if (set_gid)
+ if (set_gid) {
+ if (setegid(set_gid) == -1)
+ ERROR("main: setgid");
if (setgid(set_gid) == -1)
ERROR("main: setgid");
+ }
- if (set_uid)
+ if (set_uid) {
+ if (seteuid(set_uid) == -1)
+ ERROR("main: setuid");
if (setuid(set_uid) == -1)
ERROR("main: setuid");
+ }
/*
** Do some special handling if the "-b" or "-w" flags are used