#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/linux/net-next.git' title='net-next.git Git repository'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-11 12:19:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-11 12:19:57 -0700
commita56711fa0b418a2cf5eefa00ee65e16443e47790 (patch)
tree4ae117f86b685be4a2339579c0d0dc1c81164c4b /Documentation/devicetree/bindings/mmc
parentbf16200689118d19de1b8d2a3c314fc21f5dc7bb (diff)
parent0dee6c82c2aa5342357dabd0e536a97f72039f0b (diff)
Merge tag 'arc-4.6-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC fixes from Vineet Gupta: - fix Kconfig splat due to pcie rework - make ethernet work again on axs103 - provide fb_pgprotect() for future video driver integration * tag 'arc-4.6-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: [plat-axs103] Enable loop block devices Revert "ARC: [plat-axs10x] add Ethernet PHY description in .dts" arc: Add our own implementation of fb_pgprotect() ARC: Don't source drivers/pci/pcie/Kconfig ourselves
Diffstat (limited to 'Documentation/devicetree/bindings/mmc')