#include #include #include "privs.h" #include "die.h" 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)); } it' title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-02-07 10:40:50 +0100
committerJohannes Berg <johannes.berg@intel.com>2017-02-07 10:40:50 +0100
commitbddb2afcb6c52a545f18fb9bcd4829828ebf4a3a (patch)
tree0021fe481f8acf3694d92d72f3dd1b2a71a20ca3 /tools/testing/selftests/powerpc
parent228c8c6b1f4376788e9d5ab00d50b10228eb40d3 (diff)
mac80211: add back lost debugfs files
Somehow these files were never present or lost, but the code is there and they seem somewhat useful, so add them back. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'tools/testing/selftests/powerpc')