#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)); } /git.distanz.ch/cgit.cgi/linux/net-next.git' title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-12-25 14:31:23 +0900
committerMichal Marek <mmarek@suse.cz>2015-01-09 17:11:43 +0100
commitdd33c03b18b3f2db791eb6a17c37d2de66e4de18 (patch)
treedc3dd52f010fc5e91ebf3616a0e4ca80e91ea891 /scripts
parentc22bd32c6663778841082a73ffc7a4cc183ddc8f (diff)
kbuild: fix cc-ifversion macro
The macro "cc-version" takes no argument. Drop $(CC) from the "cc-ifversion" definition. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')