aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Overbruck <mail@duncano.de>2020-11-12 21:26:04 +0100
committerDuncan Overbruck <mail@duncano.de>2020-11-12 22:29:10 +0100
commit17629b9ce63dba6aa4146d483cd61448cddb1fa5 (patch)
treef968bfb61de2584e5926c7127408eca76512c372
parent46d2543203501994e10bfdac24392653f2325657 (diff)
downloadopendoas-17629b9ce63dba6aa4146d483cd61448cddb1fa5.tar.gz
configure: add setresgid, setreuid and setregid checks
-rwxr-xr-xconfigure42
1 files changed, 40 insertions, 2 deletions
diff --git a/configure b/configure
index d6c85af..0dfc649 100755
--- a/configure
+++ b/configure
@@ -384,9 +384,47 @@ int main(void) {
setresuid(0, 0, 0);
return 0;
}'
-check_func "setresuid" "$src" || {
+check_func "setresuid" "$src"
+have_setresuid=$?
+
+#
+# Check for setresgid().
+#
+src='
+#include <unistd.h>
+int main(void) {
+ setresgid(0, 0, 0);
+ return 0;
+}'
+check_func "setresgid" "$src"
+have_setresgid=$?
+
+if [ $have_setresuid -eq 1 -o $have_setresgid -eq 1 ]; then
printf 'SRCS += libopenbsd/bsd-setres_id.c\n' >>$CONFIG_MK
-}
+fi
+
+#
+# Check for setreuid().
+#
+src='
+#include <unistd.h>
+int main(void) {
+ setreuid(0, 0);
+ return 0;
+}'
+check_func "setreuid" "$src"
+
+
+#
+# Check for setregid().
+#
+src='
+#include <unistd.h>
+int main(void) {
+ setregid(0, 0);
+ return 0;
+}'
+check_func "setregid" "$src"
#
# Check for closefrom().