mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Merge branch '3654-main-doesn-t-compile-on-macos' into 'main'
Resolve "Main doesn't compile on MacOS" Closes #3654 See merge request isc-projects/bind9!7031
This commit is contained in:
@@ -269,8 +269,8 @@ getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid) {
|
||||
#if !HAVE_SETRESGID
|
||||
static int
|
||||
setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
|
||||
REQUIRE(rgid == -1);
|
||||
REQUIRE(sgid == -1);
|
||||
REQUIRE(rgid == (gid_t)-1);
|
||||
REQUIRE(sgid == (gid_t)-1);
|
||||
|
||||
#if HAVE_SETREGID
|
||||
return (setregid(rgid, egid));
|
||||
@@ -283,9 +283,9 @@ setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
|
||||
#if !HAVE_GETRESUID
|
||||
static int
|
||||
getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) {
|
||||
*rgid = -1;
|
||||
*egid = geteuid();
|
||||
*sgid = -1;
|
||||
*ruid = -1;
|
||||
*euid = geteuid();
|
||||
*suid = -1;
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -294,13 +294,13 @@ getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) {
|
||||
#if !HAVE_SETRESUID
|
||||
static int
|
||||
setresuid(uid_t ruid, uid_t euid, uid_t suid) {
|
||||
REQUIRE(rgid == -1);
|
||||
REQUIRE(sgid == -1);
|
||||
REQUIRE(ruid == (uid_t)-1);
|
||||
REQUIRE(suid == (uid_t)-1);
|
||||
|
||||
#if HAVE_SETREGID
|
||||
return (setregid(rgid, egid));
|
||||
return (setregid(ruid, euid));
|
||||
#else /* HAVE_SETREGID */
|
||||
return (setegid(egid));
|
||||
return (setegid(euid));
|
||||
#endif /* HAVE_SETREGID */
|
||||
}
|
||||
#endif /* !HAVE_SETRESUID */
|
||||
|
Reference in New Issue
Block a user