summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
Diffstat (limited to 'uidswap.c')
-rw-r--r--uidswap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/uidswap.c b/uidswap.c
index 1d78c607a..40e121503 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -162,8 +162,10 @@ restore_uid(void)
162 * Propagate the real uid (usually more privileged) to effective uid 162 * Propagate the real uid (usually more privileged) to effective uid
163 * as well. 163 * as well.
164 */ 164 */
165 setuid(getuid()); 165 if (setuid(getuid()) == -1)
166 setgid(getgid()); 166 fatal("%s: setuid failed: %s", __func__, strerror(errno));
167 if (setgid(getgid()) == -1)
168 fatal("%s: setgid failed: %s", __func__, strerror(errno));
167#endif /* SAVED_IDS_WORK_WITH_SETEUID */ 169#endif /* SAVED_IDS_WORK_WITH_SETEUID */
168 170
169 if (setgroups(saved_egroupslen, saved_egroups) == -1) 171 if (setgroups(saved_egroupslen, saved_egroups) == -1)