From 6d59dcf167dea452f0b556a05393c5a1bd9835fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 20 Aug 2024 09:14:31 +0200 Subject: [PATCH] Fix the resesuid() shim implementation for NetBSD The shim implementation of setresuid() was wrong - there was a copy and paste error and it was calling setresgid() instead. This only affects NetBSD because Linux, FreeBSD and OpenBSD have setresuid() and setresgid() implementation available from the system library. (cherry picked from commit 5567407a824ed4c43dd723a9a113518b9186102f) --- bin/named/os.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/named/os.c b/bin/named/os.c index 9efc114479..f07d943550 100644 --- a/bin/named/os.c +++ b/bin/named/os.c @@ -295,11 +295,11 @@ setresuid(uid_t ruid, uid_t euid, uid_t suid) { REQUIRE(ruid == (uid_t)-1); REQUIRE(suid == (uid_t)-1); -#if HAVE_SETREGID - return (setregid(ruid, euid)); -#else /* HAVE_SETREGID */ - return (setegid(euid)); -#endif /* HAVE_SETREGID */ +#if HAVE_SETREUID + return (setreuid(ruid, euid)); +#else /* HAVE_SETREUID */ + return (seteuid(euid)); +#endif /* HAVE_SETREUID */ } #endif /* !HAVE_SETRESUID */