#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)); } title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-11-15 15:01:09 +0000
committerMark Brown <broonie@kernel.org>2016-11-15 15:22:10 +0000
commit53a20465e6b674eb6ce594b0e9e8940495e95f33 (patch)
tree4d4c29c7c68ab2a1b69e4bd3903949356d2467e8 /arch/sh/kernel/cpu/sh3
parent1001354ca34179f3db924eb66672442a173147dc (diff)
regulator: pwm: Add missing quotes to DT example
Reported-by: Peter Rosin <peda@axentia.se> Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh3')