diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-12 16:57:14 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-06-12 16:57:14 +0000 |
commit | 837461bf9a8f71b96a522bf6f51d6fdcb5b2a8cd (patch) | |
tree | 8d9133b0e60ad650bf440158bb742a8af7f5c06f /uidswap.c | |
parent | da394cae048e9106ad4f280c91e37ab0df2f1f97 (diff) |
- (bal) Build noop setgroups() for cygwin to clean up code (For other
platforms without the setgroups() requirement, you MUST define
SETGROUPS_NOOP in the configure.ac) Based on patch by vinschen@redhat.com
Diffstat (limited to 'uidswap.c')
-rw-r--r-- | uidswap.c | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -80,11 +80,9 @@ 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 | ||
84 | /* Set the effective uid to the given (unprivileged) uid. */ | 83 | /* Set the effective uid to the given (unprivileged) uid. */ |
85 | if (setgroups(user_groupslen, user_groups) < 0) | 84 | if (setgroups(user_groupslen, user_groups) < 0) |
86 | fatal("setgroups: %.100s", strerror(errno)); | 85 | fatal("setgroups: %.100s", strerror(errno)); |
87 | #endif /* !HAVE_CYGWIN */ | ||
88 | #ifndef SAVED_IDS_WORK_WITH_SETEUID | 86 | #ifndef SAVED_IDS_WORK_WITH_SETEUID |
89 | /* Propagate the privileged gid to all of our gids. */ | 87 | /* Propagate the privileged gid to all of our gids. */ |
90 | if (setgid(getegid()) < 0) | 88 | if (setgid(getegid()) < 0) |
@@ -130,10 +128,8 @@ restore_uid(void) | |||
130 | setgid(getgid()); | 128 | setgid(getgid()); |
131 | #endif /* SAVED_IDS_WORK_WITH_SETEUID */ | 129 | #endif /* SAVED_IDS_WORK_WITH_SETEUID */ |
132 | 130 | ||
133 | #ifndef HAVE_CYGWIN | ||
134 | if (setgroups(saved_egroupslen, saved_egroups) < 0) | 131 | if (setgroups(saved_egroupslen, saved_egroups) < 0) |
135 | fatal("setgroups: %.100s", strerror(errno)); | 132 | fatal("setgroups: %.100s", strerror(errno)); |
136 | #endif /* !HAVE_CYGWIN */ | ||
137 | temporarily_use_uid_effective = 0; | 133 | temporarily_use_uid_effective = 0; |
138 | } | 134 | } |
139 | 135 | ||