summaryrefslogtreecommitdiff
path: root/xutils.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-04 10:52:34 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-04 10:53:19 +0200
commit4722d3bac43062a9213a08ed2435b8ef9b426789 (patch)
treefa40f2282cda080bd697b976ae0f6ab89a38a6d4 /xutils.c
parent23bd5ecbd11766088784507a56e32975b4c755a2 (diff)
privs: move drop_privileges out of xutils
Again, also to be able to maintain this more easily. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'xutils.c')
-rw-r--r--xutils.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/xutils.c b/xutils.c
index 28900cb..b1f73a4 100644
--- a/xutils.c
+++ b/xutils.c
@@ -201,20 +201,6 @@ u32 wireless_bitrate(const char *ifname)
return rate_in_mbit;
}
-void drop_privileges(bool enforce, uid_t uid, gid_t gid)
-{
- if (enforce) {
- if (uid == getuid())
- panic("Uid cannot be the same as the current user!\n");
- if (gid == getgid())
- panic("Gid cannot be the same as the current user!\n");
- }
- if (setgid(gid) != 0)
- panic("Unable to drop group privileges: %s!\n", strerror(errno));
- if (setuid(uid) != 0)
- panic("Unable to drop user privileges: %s!\n", strerror(errno));
-}
-
int get_system_socket_mem(int which)
{
int fd, val = -1;