#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)); } ='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:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-01-11 16:32:17 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2017-01-12 12:43:41 +0200
commit6c0b2e833f1439ebcbd7258b655623c1aef23ffb (patch)
tree9259fa21758a63605b663cd2ef33eb4f3a5604f8
parenta505e58252715bbc18a0ee1abae23615fe2586db (diff)
soc: qcom: smem_state: Fix include for ERR_PTR()
The correct include file for getting errno constants and ERR_PTR() is linux/err.h, rather than linux/errno.h, so fix the include. Fixes: e8b123e60084 ("soc: qcom: smem_state: Add stubs for disabled smem_state") Acked-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>