Include uid_wrapper correctly.
authorAndreas Schneider <asn@samba.org>
Thu, 27 Oct 2011 10:00:53 +0000 (12:00 +0200)
committerAndreas Schneider <asn@samba.org>
Thu, 27 Oct 2011 11:32:02 +0000 (13:32 +0200)
12 files changed:
lib/replace/system/passwd.h
lib/uid_wrapper/uid_wrapper.c
lib/uid_wrapper/uid_wrapper.h
lib/util/unix_privs.c
lib/util/util.c
source3/lib/system.c
source3/lib/util_sec.c
source3/rpc_server/rpc_handles.c
source3/rpc_server/srv_access_check.c
source3/smbd/sec_ctx.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/unixuid/vfs_unixuid.c

index aaea9c8344e75b0dc02c972ffc83dd1ec8273ae6..f630012f00081d37352ee72deccae18ec52f9617 100644 (file)
@@ -109,4 +109,15 @@ char *rep_getpass(const char *prompt);
 #endif /* NSS_WRAPPER_DISABLE */
 #endif /* NSS_WRAPPER */
 
+#ifdef UID_WRAPPER
+# ifndef UID_WRAPPER_DISABLE
+#  ifndef UID_WRAPPER_NOT_REPLACE
+#   define UID_WRAPPER_REPLACE
+#  endif /* UID_WRAPPER_NOT_REPLACE */
+#  include "../uid_wrapper/uid_wrapper.h"
+# endif /* UID_WRAPPER_DISABLE */
+#else /* UID_WRAPPER */
+# define uwrap_enabled() 0
+#endif /* UID_WRAPPER */
+
 #endif
index c43dbc1436828bd1319d0e42553073d91763796c..898d1afbb9c5fbedb9ddc7d45a9ba9cc4071e876 100644 (file)
@@ -19,9 +19,9 @@
 #ifdef _SAMBA_BUILD_
 
 #define UID_WRAPPER_NOT_REPLACE
-#include "../replace/replace.h"
-#include <talloc.h>
+#include "replace.h"
 #include "system/passwd.h"
+#include <talloc.h>
 
 #else /* _SAMBA_BUILD_ */
 
index 7cb97af8dfbe1456c1f51687e203fa84b6ac41e2..680e5445833c4876a10d847feb12894f1dfb8cc5 100644 (file)
@@ -33,6 +33,8 @@ int uwrap_getgroups(int size, gid_t *list);
 uid_t uwrap_getuid(void);
 gid_t uwrap_getgid(void);
 
+#ifdef UID_WRAPPER_REPLACE
+
 #ifdef seteuid
 #undef seteuid
 #endif
@@ -93,5 +95,6 @@ gid_t uwrap_getgid(void);
 #endif
 #define getgid uwrap_getgid
 
-#endif
+#endif /* UID_WRAPPER_REPLACE */
+#endif /* uwrap_enabled */
 #endif /* __UID_WRAPPER_H__ */
index 9aa9a459189bcd338a60a00ac94866f59ab70dfa..baa54fd5584fd16b5d9f15a2b8e63cb907dbb32e 100644 (file)
 #include "system/passwd.h"
 #include "../lib/util/unix_privs.h"
 
-#if defined(UID_WRAPPER)
-#if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE)
-#define UID_WRAPPER_REPLACE
-#include "../uid_wrapper/uid_wrapper.h"
-#endif
-#else
-#define uwrap_enabled() 0
-#endif
-
 /**
  * @file
  * @brief Gaining/losing root privileges
index 133bd0dfb0b42658a06d6386a85daa6a2811e3fc..c7c37bc815201f6816ad186c5f1286e42047757f 100644 (file)
@@ -27,6 +27,7 @@
 #include "system/filesys.h"
 #include "system/locale.h"
 #include "system/shmem.h"
+#include "system/passwd.h"
 
 #undef malloc
 #undef strcasecmp
 #undef strdup
 #undef realloc
 
-#if defined(UID_WRAPPER)
-#if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE)
-#define UID_WRAPPER_REPLACE
-#include "../uid_wrapper/uid_wrapper.h"
-#endif
-#else
-#define uwrap_enabled() 0
-#endif
-
 /**
  * @file
  * @brief Misc utility functions
index 45fe77e3445036c8d670c177045e672f61812c5d..85988417a65ed434403b3f7bbc0779fa1a0622e6 100644 (file)
@@ -25,7 +25,6 @@
 #include "system/capability.h"
 #include "system/passwd.h"
 #include "system/filesys.h"
-#include "lib/uid_wrapper/uid_wrapper.h"
 
 #ifdef HAVE_SYS_PRCTL_H
 #include <sys/prctl.h>
index 0e2eee44af81ab7f15d714c1c9d134ba8977e9a2..60ea214d262ea30a10a0cf718ececba1e1d986b0 100644 (file)
@@ -19,7 +19,7 @@
 
 #ifndef AUTOCONF_TEST
 #include "includes.h"
-#include "lib/uid_wrapper/uid_wrapper.h"
+#include "system/passwd.h" /* uid_wrapper */
 #else
 /* we are running this code in autoconf test mode to see which type of setuid
    function works */
index 87145ca848f5f84a9413f38af7babfdc564acc26..d547f18dc1e5ccb053b7570198f235d89ee60d3e 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "includes.h"
+#include "system/passwd.h" /* uid_wrapper */
 #include "../librpc/gen_ndr/ndr_lsa.h"
 #include "../librpc/gen_ndr/ndr_samr.h"
 #include "auth.h"
index 4e74b0443a72113a24258bfb80a86b8b00bc4224..f667d7b23d06346da504b3cff57aa6c383a09963 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include "includes.h"
+#include "system/passwd.h" /* uid_wrapper */
 #include "rpc_server/srv_access_check.h"
 #include "../libcli/security/security.h"
 #include "passdb/machine_sid.h"
index 446810d535c2626c4e6ab8e9e0a454fefa537816..99592815e3f953ee6407f9bc3265c877af27f2b6 100644 (file)
 */
 
 #include "includes.h"
+#include "system/passwd.h"
 #include "smbd/smbd.h"
 #include "smbd/globals.h"
 #include "libcli/security/security_token.h"
 #include "auth.h"
 #include "smbprofile.h"
-#include "lib/uid_wrapper/uid_wrapper.h"
 
 extern struct current_user current_user;
 
index 8157d862ec2fdb06d911428ebff5091dd961c87b..b253b8ab2d4f211019cf5fd98ae937d63d09efac 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "system/passwd.h"
 #include "auth/auth.h"
 #include "vfs_posix.h"
 #include "librpc/gen_ndr/xattr.h"
 #include "../lib/util/unix_privs.h"
 #include "lib/util/samba_modules.h"
 
-#if defined(UID_WRAPPER)
-#if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE)
-#define UID_WRAPPER_REPLACE
-#include "../uid_wrapper/uid_wrapper.h"
-#endif
-#else
-#define uwrap_enabled() 0
-#endif
-
 /* the list of currently registered ACL backends */
 static struct pvfs_acl_backend {
        const struct pvfs_acl_ops *ops;
index 0221b4391c1de1caa807dc74595e044946bb9dca..7e7fd443d54e77ca56ef3915d745f1e0210ca211 100644 (file)
 #define TEVENT_DEPRECATED
 #include <tevent.h>
 
-#if defined(UID_WRAPPER)
-#if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE)
-#define UID_WRAPPER_REPLACE
-#include "../uid_wrapper/uid_wrapper.h"
-#endif
-#else
-#define uwrap_enabled() 0
-#endif
-
-
 NTSTATUS ntvfs_unixuid_init(void);
 
 struct unixuid_private {