diff options
author | Jeremy Allison <jra@samba.org> | 2012-06-29 13:46:23 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-06-30 00:32:36 +0200 |
commit | f81fd1ccc3228bf06455ad4c3265b71ca17ae407 (patch) | |
tree | d09aed8da40fb158d599f5fffc6b7765734f91ca | |
parent | d91bf0d42863c996df5bf3c0d57e329d7a58a6af (diff) | |
download | samba-f81fd1ccc3228bf06455ad4c3265b71ca17ae407.tar.gz samba-f81fd1ccc3228bf06455ad4c3265b71ca17ae407.tar.bz2 samba-f81fd1ccc3228bf06455ad4c3265b71ca17ae407.zip |
Try and fix the autoconf build on Solaris/Nexenta/etc.
Their AC_TRY_RUN doesn't include any current CPPFLAGS. Make
the set[res]uid checks independent of this. Needs a small
change to the waf build in order to code with the change.
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 30 00:32:36 CEST 2012 on sn-devel-104
-rw-r--r-- | lib/util/setid.c | 33 | ||||
-rw-r--r-- | source3/configure.in | 6 | ||||
-rw-r--r-- | source3/lib/util_sec.c | 3 | ||||
-rwxr-xr-x | source3/wscript | 5 |
4 files changed, 42 insertions, 5 deletions
diff --git a/lib/util/setid.c b/lib/util/setid.c index 66c06397ee..885b8bf186 100644 --- a/lib/util/setid.c +++ b/lib/util/setid.c @@ -64,11 +64,42 @@ int samba_setgid(gid_t gid); int samba_setuidx(int flags, uid_t uid); int samba_setgidx(int flags, gid_t gid); int samba_setgroups(size_t setlen, const gid_t *gidset); +#endif + +#include "../lib/util/setid.h" +#else + +/* Inside autoconf test. */ +#if defined(HAVE_UNISTD_H) +#include <unistd.h> #endif +#include <stdlib.h> +#include <stdio.h> +#include <sys/types.h> +#include <errno.h> + +#ifdef HAVE_SYS_PRIV_H +#include <sys/priv.h> +#endif +#ifdef HAVE_SYS_ID_H +#include <sys/id.h> #endif -#include "../lib/util/setid.h" +/* autoconf tests don't include setid.h */ +int samba_setresuid(uid_t ruid, uid_t euid, uid_t suid); +int samba_setresgid(gid_t rgid, gid_t egid, gid_t sgid); +int samba_setreuid(uid_t ruid, uid_t euid); +int samba_setregid(gid_t rgid, gid_t egid); +int samba_seteuid(uid_t euid); +int samba_setegid(gid_t egid); +int samba_setuid(uid_t uid); +int samba_setgid(gid_t gid); +int samba_setuidx(int flags, uid_t uid); +int samba_setgidx(int flags, gid_t gid); +int samba_setgroups(size_t setlen, const gid_t *gidset); + +#endif #if defined(USE_LINUX_THREAD_CREDENTIALS) #if defined(HAVE_SYSCALL_H) diff --git a/source3/configure.in b/source3/configure.in index 483072f0f5..a9640d87e3 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2773,7 +2773,7 @@ AC_CACHE_CHECK([for Linux thread-specific credentials],samba_cv_USE_LINUX_THREAD AC_TRY_RUN([ #define AUTOCONF_TEST 1 #define USE_LINUX_THREAD_CREDENTIALS 1 -#include "confdefs.h" +#include "${srcdir-.}/../lib/util/setid.c" #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_LINUX_THREAD_CREDENTIALS=yes,samba_cv_USE_LINUX_THREAD_CREDENTIALS=no,samba_cv_USE_LINUX_THREAD_CREDENTIALS=cross)]) if test x"$samba_cv_USE_LINUX_THREAD_CREDENTIALS" = x"yes"; then @@ -2789,6 +2789,7 @@ AC_TRY_RUN([ #define AUTOCONF_TEST 1 #define USE_SETREUID 1 #include "confdefs.h" +#include "${srcdir-.}/../lib/util/setid.c" #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 @@ -2804,6 +2805,7 @@ AC_TRY_RUN([ #define AUTOCONF_TEST 1 #define USE_SETRESUID 1 #include "confdefs.h" +#include "${srcdir-.}/../lib/util/setid.c" #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 @@ -2817,6 +2819,7 @@ AC_TRY_RUN([ #define AUTOCONF_TEST 1 #define USE_SETEUID 1 #include "confdefs.h" +#include "${srcdir-.}/../lib/util/setid.c" #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)]) if test x"$samba_cv_USE_SETEUID" = x"yes"; then @@ -2830,6 +2833,7 @@ AC_TRY_RUN([ #define AUTOCONF_TEST 1 #define USE_SETUIDX 1 #include "confdefs.h" +#include "${srcdir-.}/../lib/util/setid.c" #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)]) if test x"$samba_cv_USE_SETUIDX" = x"yes"; then diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index cee11d9f96..11d85a102a 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -40,9 +40,6 @@ #include <sys/id.h> #endif -/* In autoconf/test mode include the definitions of samba_setXXX. */ -#include "../lib/util/setid.c" - #define DEBUG(x, y) printf y #define smb_panic(x) exit(1) #define bool int diff --git a/source3/wscript b/source3/wscript index 449bf20e05..cc05095c25 100755 --- a/source3/wscript +++ b/source3/wscript @@ -733,6 +733,7 @@ int i; i = PAM_RADIO_TYPE; seteuid = conf.CHECK_CODE(''' #define AUTOCONF_TEST 1 #define USE_LINUX_THREAD_CREDENTIALS 1 + #include "../lib/util/setid.c" #include "./lib/util_sec.c" ''', 'USE_LINUX_THREAD_CREDENTIALS', @@ -743,6 +744,7 @@ int i; i = PAM_RADIO_TYPE; seteuid = conf.CHECK_CODE(''' #define AUTOCONF_TEST 1 #define USE_SETREUID 1 + #include "../lib/util/setid.c" #include "./lib/util_sec.c" ''', 'USE_SETREUID', @@ -753,6 +755,7 @@ int i; i = PAM_RADIO_TYPE; seteuid = conf.CHECK_CODE(''' #define AUTOCONF_TEST 1 #define USE_SETRESUID 1 + #include "../lib/util/setid.c" #include "./lib/util_sec.c" ''', 'USE_SETRESUID', @@ -763,6 +766,7 @@ int i; i = PAM_RADIO_TYPE; seteuid = conf.CHECK_CODE(''' #define AUTOCONF_TEST 1 #define USE_SETEUID 1 + #include "../lib/util/setid.c" #include "./lib/util_sec.c" ''', 'USE_SETEUID', @@ -773,6 +777,7 @@ int i; i = PAM_RADIO_TYPE; seteuid = conf.CHECK_CODE(''' #define AUTOCONF_TEST 1 #define USE_SETUIDX 1 + #include "../lib/util/setid.c" #include "./lib/util_sec.c" ''', 'USE_SETUIDX', |