|
Lines 151-157
permanently_set_uid(struct passwd *pw)
Link Here
|
| 151 |
debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, |
151 |
debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, |
| 152 |
(u_int)pw->pw_gid); |
152 |
(u_int)pw->pw_gid); |
| 153 |
|
153 |
|
| 154 |
#if defined(HAVE_SETRESGID) |
154 |
#if defined(HAVE_SETRESGID) && !defined(BROKEN_SETRESGID) |
| 155 |
if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) < 0) |
155 |
if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) < 0) |
| 156 |
fatal("setresgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); |
156 |
fatal("setresgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); |
| 157 |
#elif defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID) |
157 |
#elif defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID) |
|
Lines 164-170
permanently_set_uid(struct passwd *pw)
Link Here
|
| 164 |
fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); |
164 |
fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); |
| 165 |
#endif |
165 |
#endif |
| 166 |
|
166 |
|
| 167 |
#if defined(HAVE_SETRESUID) |
167 |
#if defined(HAVE_SETRESUID) && !defined(BROKEN_SETRESUID) |
| 168 |
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) |
168 |
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) |
| 169 |
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); |
169 |
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); |
| 170 |
#elif defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID) |
170 |
#elif defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID) |