]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix bug #217
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 7 Nov 2008 09:24:39 +0000 (09:24 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 7 Nov 2008 09:24:39 +0000 (09:24 +0000)
git-svn-id: file:///svn/unbound/trunk@1336 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
daemon/unbound.c
doc/Changelog

index 35ad34434684f939d30a4f5a023a1dee5706b1a8..308718c0059b450cdf931a8e99e7cff624383fba 100644 (file)
@@ -6,6 +6,10 @@
 /* Pathname to the Unbound configuration file */
 #undef CONFIGFILE
 
+/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
+   */
+#undef DARWIN_BROKEN_SETREUID
+
 /* Define if you want to use debug lock checking (slow). */
 #undef ENABLE_LOCK_CHECKS
 
index 3c2d89a367ebfc3948bda262147249437b2a8ff1..5dcea7ea9e75275fb50355a18fa9c983ef4bf12e 100755 (executable)
--- a/configure
+++ b/configure
 done
 
 
+# check if setreuid en setregid fail, on MacOSX10.4(darwin8).
+if echo $build_os | grep darwin8 > /dev/null; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DARWIN_BROKEN_SETREUID 1
+_ACEOF
+
+fi
+
 # check mkdir
 { echo "$as_me:$LINENO: checking whether mkdir has one arg" >&5
 echo $ECHO_N "checking whether mkdir has one arg... $ECHO_C" >&6; }
index 61b5b2e6730588169552dbae217726d582530c32..a0c0ff8a50c2cf37bfdd600347c66a1244c0b93e 100644 (file)
@@ -797,6 +797,11 @@ AC_LIBOBJ([fake-rfc2553])
 fi
 AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid])
 
+# check if setreuid en setregid fail, on MacOSX10.4(darwin8).
+if echo $build_os | grep darwin8 > /dev/null; then
+       AC_DEFINE(DARWIN_BROKEN_SETREUID, 1, [Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work])
+fi
+
 # check mkdir
 AC_MSG_CHECKING([whether mkdir has one arg])
 AC_TRY_COMPILE([
index 2a53ca0b52bcf9833e2bb764a61f78e8fdbe4a59..0fcd52c201b4c0b71eacb3caf924a40f03056f7f 100644 (file)
@@ -443,7 +443,7 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
        if(cfg->username && cfg->username[0]) {
 #ifdef HAVE_SETRESGID
                if(setresgid(gid,gid,gid) != 0)
-#elif defined(HAVE_SETREGID)
+#elif defined(HAVE_SETREGID) && !defined(DARWIN_BROKEN_SETREUID)
                if(setregid(gid,gid) != 0)
 #else /* use setgid */
                if(setgid(gid) != 0)
@@ -452,7 +452,7 @@ perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode,
                                cfg->username, strerror(errno));
 #ifdef HAVE_SETRESUID
                if(setresuid(uid,uid,uid) != 0)
-#elif defined(HAVE_SETREUID)
+#elif defined(HAVE_SETREUID) && !defined(DARWIN_BROKEN_SETREUID)
                if(setreuid(uid,uid) != 0)
 #else /* use setuid */
                if(setuid(uid) != 0)
index 43fcefe9a7dd37fbad81e3f53c1f0c2f76ac1162..894bcc6a84a231acdfd55ca888a41bd2fc81e4e0 100644 (file)
@@ -1,3 +1,6 @@
+7 November 2008: Wouter
+       - fix bug 217: fixed, setreuid and setregid do not work on MacOSX10.4.
+
 6 November 2008: Wouter
        - dname_priv must decompress the name before comparison.
        - iana portlist updated.