Fixed configure bug with RedHat 5.1 where it uses setresgid even though
authorJeremy Allison <jra@samba.org>
Fri, 11 Dec 1998 00:24:23 +0000 (00:24 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 11 Dec 1998 00:24:23 +0000 (00:24 +0000)
this is not yet implemented.
Jeremy.

source/configure
source/configure.in

index 44d884bdc32056aec53fc5337e1850b7ba9a7b0a..59809cd9ddb242ecb492bd47beaec3f671cf6439 100755 (executable)
@@ -3025,7 +3025,7 @@ else
 #include "confdefs.h"
 #include <unistd.h>
 #include <errno.h>
-main() { setresgid(1,1,1); exit(0);}
+main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}
 EOF
 if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
index cf730e8f2bc156dcef5a2110459fda3ea4c7f771..3554cddba57755de04abee88ae8f84c0b25785dc 100644 (file)
@@ -190,7 +190,7 @@ fi
 AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
     AC_TRY_RUN([#include <unistd.h>
 #include <errno.h>
-main() { setresgid(1,1,1); exit(0);}],
+main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
        samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no)])
 if test x"$samba_cv_have_setresgid" = x"yes"; then
     AC_DEFINE(HAVE_SETRESGID)