Avoid a race condition in glibc between AIO and setresuid().
[samba.git] / source3 / configure.in
index 6806ed22aeddeace0bf489a2a5a24d528a095073..9436fed1fff196f5ede3faa6fdccd9b6921da50a 100644 (file)
@@ -2627,30 +2627,32 @@ AC_CHECK_FUNCS(getpagesize)
 ################################################
 # look for a method of setting the effective uid
 seteuid=no;
+
 if test $seteuid = no; then
-AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
+AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
 AC_TRY_RUN([
 #define AUTOCONF_TEST 1
-#define USE_SETRESUID 1
+#define USE_SETREUID 1
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"],
-           samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
-if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
-    seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
+           samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
+if test x"$samba_cv_USE_SETREUID" = x"yes"; then
+    seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
 fi
 fi
 
-
+# we check for setresuid second as it conflicts with AIO on Linux. 
+# see http://samba.org/~tridge/junkcode/aio_uid.c
 if test $seteuid = no; then
-AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
+AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
 AC_TRY_RUN([
 #define AUTOCONF_TEST 1
-#define USE_SETREUID 1
+#define USE_SETRESUID 1
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"],
-           samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
-if test x"$samba_cv_USE_SETREUID" = x"yes"; then
-    seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
+           samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
+if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
+    seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
 fi
 fi
 
@@ -3382,6 +3384,8 @@ if test x"$with_ads_support" != x"no"; then
   AC_CHECK_FUNC_EXT(krb5_get_init_creds_opt_free, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_get_init_creds_opt_get_error, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_enctype_to_string, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_fwd_tgt_creds, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_auth_con_set_req_cksumtype, $KRB5_LIBS)
 
   LIBS="$KRB5_LIBS $LIBS"
 
@@ -4046,7 +4050,7 @@ INSTALL_CIFSUPCALL=""
 UNINSTALL_CIFSUPCALL=""
 AC_MSG_CHECKING(whether to build cifs.upcall)
 AC_ARG_WITH(cifsupcall,
-[AS_HELP_STRING([--with-cifsupcall], [Include cifs.upcall (Linux only) support (default=no)])],
+[AS_HELP_STRING([--with-cifsupcall], [Include cifs.upcall (Linux only) support (default=yes)])],
 [ case "$withval" in
   no)
        AC_MSG_RESULT(no)
@@ -4072,9 +4076,24 @@ AC_ARG_WITH(cifsupcall,
        esac
     ;;
   esac ],
-[
-  AC_MSG_RESULT(no)
-  ]
+[ case "$host_os" in
+  *linux*)
+       if test x"$use_ads" != x"yes"; then
+               AC_MSG_WARN(ADS support should be enabled for building cifs.upcall)
+       elif test x"$HAVE_KEYUTILS_H" != "x1"; then
+               AC_MSG_WARN(keyutils package is required for cifs.upcall)
+       else
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(WITH_CIFSUPCALL,1,[whether to build cifs.upcall])
+               CIFSUPCALL_PROGS="bin/cifs.upcall"
+               INSTALL_CIFSUPCALL="installcifsupcall"
+               UNINSTALL_CIFSUPCALL="uninstallcifsupcall"
+       fi
+       ;;
+  *)
+       AC_MSG_RESULT(no)
+       ;;
+  esac ]
 )
 
 
@@ -6142,10 +6161,12 @@ AC_SUBST(SMBD_LIBS)
 AC_OUTPUT(Makefile
          script/findsmb smbadduser script/gen-8bit-gap.sh script/installbin.sh script/uninstallbin.sh
          lib/netapi/examples/Makefile
+         lib/netapi/tests/Makefile
          pkgconfig/smbclient.pc
          pkgconfig/wbclient.pc
          pkgconfig/netapi.pc
          pkgconfig/smbsharemodes.pc
+         ../examples/libsmbclient/Makefile.internal
          )
 
 #################################################