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.
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 */