s3-waf: add check for seteuid method.
authorGünther Deschner <gd@samba.org>
Fri, 24 Sep 2010 01:15:09 +0000 (18:15 -0700)
committerGünther Deschner <gd@samba.org>
Fri, 24 Sep 2010 01:15:09 +0000 (18:15 -0700)
Thanks to Kai and Metze!

Guenther

source3/wscript

index 54342d53714f44395f897692df313db44c079323..5bb8f69640c19206a056f20e683ab216aa4ded2a 100644 (file)
@@ -600,6 +600,50 @@ return 0;
         if conf.env.with_iconv:
             conf.DEFINE('HAVE_ICONV', 1)
 
+    seteuid = False
+    if not seteuid:
+        seteuid = conf.CHECK_CODE('''
+                               #define AUTOCONF_TEST 1
+                               #define USE_SETREUID 1
+                               #include "./lib/util_sec.c"
+                               ''',
+                               'USE_SETREUID',
+                               addmain=False,
+                               execute=True,
+                               msg="Checking whether setreuid is available")
+    if not seteuid:
+        seteuid = conf.CHECK_CODE('''
+                               #define AUTOCONF_TEST 1
+                               #define USE_SETRESUID 1
+                               #include "./lib/util_sec.c"
+                               ''',
+                               'USE_SETRESUID',
+                               addmain=False,
+                               execute=True,
+                               msg="Checking whether setresuid is available")
+    if not seteuid:
+        seteuid = conf.CHECK_CODE('''
+                               #define AUTOCONF_TEST 1
+                               #define USE_SETEUID 1
+                               #include "./lib/util_sec.c"
+                               ''',
+                               'USE_SETEUID',
+                               addmain=False,
+                               execute=True,
+                               msg="Checking whether seteuid is available")
+    if not seteuid:
+        seteuid = conf.CHECK_CODE('''
+                               #define AUTOCONF_TEST 1
+                               #define USE_SETUIDX 1
+                               #include "./lib/util_sec.c"
+                               ''',
+                               'USE_SETUIDX',
+                               addmain=False,
+                               execute=True,
+                               mandatory=True,
+                               msg="Checking whether setuidx is available")
+
+
     # FIXME: these should be tests for features, but the old build system just
     # checks for OSes.
     import sys