summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/providers/ipa/selinux_child.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/providers/ipa/selinux_child.c b/src/providers/ipa/selinux_child.c
index 7297f5ed3..63d4b9297 100644
--- a/src/providers/ipa/selinux_child.c
+++ b/src/providers/ipa/selinux_child.c
@@ -220,11 +220,21 @@ int main(int argc, const char *argv[])
* We need to switch also the real ID to 0.
*/
if (getuid() != 0) {
- setuid(0);
+ ret = setuid(0);
+ if (ret == -1) {
+ ret = errno;
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ "setuid failed: %d, selinux_child might not work!\n", ret);
+ }
}
if (getgid() != 0) {
- setgid(0);
+ ret = setgid(0);
+ if (ret == -1) {
+ ret = errno;
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ "setgid failed: %d, selinux_child might not work!\n", ret);
+ }
}
DEBUG(SSSDBG_TRACE_INTERNAL,