#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)); } itory'/>
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Reynes <tremyfr@gmail.com>2017-01-01 19:02:46 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-02 16:59:10 -0500
commite938ed150f1ed9410ff50d19ac32efdd26c77903 (patch)
tree5ce505a1e88ee1bd925635437468d03abb851080
parent8e4881aa1d5d2f9c7ebfd0fe5e138f0cc345832c (diff)
net: sfc: falcon: use new api ethtool_{get|set}_link_ksettings
The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>