#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)); } pository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Zhukov <mussitantesmortem@gmail.com>2016-04-12 23:54:59 +0300
committerMichal Marek <mmarek@suse.com>2016-04-20 09:24:49 +0200
commit4deaaa4deb0f9c42452711aa0a4b9c27016ca2f0 (patch)
tree9ab8278742f7e3db79458416417e417e79910e48 /Documentation/devicetree/bindings
parentdbacb0ef670d057a2c52c0e1e642bab727f6b4cb (diff)
scripts: genksyms: fix resource leak
This commit fixed resource leak at func main Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'Documentation/devicetree/bindings')