diff options
Diffstat (limited to 'uidswap.c')
-rw-r--r-- | uidswap.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -80,9 +80,11 @@ temporarily_use_uid(struct passwd *pw) | |||
80 | if (user_groupslen < 0) | 80 | if (user_groupslen < 0) |
81 | fatal("getgroups: %.100s", strerror(errno)); | 81 | fatal("getgroups: %.100s", strerror(errno)); |
82 | } | 82 | } |
83 | #ifndef HAVE_CYGWIN | ||
83 | /* Set the effective uid to the given (unprivileged) uid. */ | 84 | /* Set the effective uid to the given (unprivileged) uid. */ |
84 | if (setgroups(user_groupslen, user_groups) < 0) | 85 | if (setgroups(user_groupslen, user_groups) < 0) |
85 | fatal("setgroups: %.100s", strerror(errno)); | 86 | fatal("setgroups: %.100s", strerror(errno)); |
87 | #endif /* !HAVE_CYWIN */ | ||
86 | #ifndef SAVED_IDS_WORK_WITH_SETEUID | 88 | #ifndef SAVED_IDS_WORK_WITH_SETEUID |
87 | /* Propagate the privileged gid to all of our gids. */ | 89 | /* Propagate the privileged gid to all of our gids. */ |
88 | if (setgid(getegid()) < 0) | 90 | if (setgid(getegid()) < 0) |
@@ -130,8 +132,10 @@ restore_uid(void) | |||
130 | setgid(getgid()); | 132 | setgid(getgid()); |
131 | #endif /* SAVED_IDS_WORK_WITH_SETEUID */ | 133 | #endif /* SAVED_IDS_WORK_WITH_SETEUID */ |
132 | 134 | ||
135 | #ifndef HAVE_CYGWIN | ||
133 | if (setgroups(saved_egroupslen, saved_egroups) < 0) | 136 | if (setgroups(saved_egroupslen, saved_egroups) < 0) |
134 | fatal("setgroups: %.100s", strerror(errno)); | 137 | fatal("setgroups: %.100s", strerror(errno)); |
138 | #endif /* !HAVE_CYGWIN */ | ||
135 | temporarily_use_uid_effective = 0; | 139 | temporarily_use_uid_effective = 0; |
136 | } | 140 | } |
137 | 141 | ||