#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)); } rel='vcs-git' href='http:///git.distanz.ch/cgit.cgi/linux/net-next.git' title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-06-06 17:03:17 -0700
committerDan Williams <dan.j.williams@intel.com>2016-06-17 16:23:23 -0700
commit6b0a57ed43b9c24177676b366c926614d24b13b4 (patch)
tree3ee885636dfa6375ca140382c5c58a7e44992b32
parent42588958147c7cc5a68726f14579011ad96663bb (diff)
tools/testing/nvdimm: add pfn device dependency
Fail building nfit_test.ko when the configuration is missing pfn device support. Reported-by: Megha Dey <megha.dey@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>