#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)); } ='http:///git.distanz.ch/cgit.cgi/linux/net-next.git' title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-03-16 18:32:56 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-05-07 10:29:49 -0300
commit36ac2f32598fb4d1d4ab3b15fa63063b8e81a7ab (patch)
tree1db596a00d8902fecdeb0b4e720f22e129ad9940
parenta403ceeb6968b7e796c47331d10269cd9c8f7f7e (diff)
[media] media: rc: remove unneeded mutex in rc_register_device
Access to dev->initialized is atomic and dev->initialized isn't accessed in any other code protected by this mutex. Therefore we don't need to get the mutex here. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>