summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/replace/system/passwd.h11
-rw-r--r--lib/uid_wrapper/uid_wrapper.c4
-rw-r--r--lib/uid_wrapper/uid_wrapper.h5
-rw-r--r--lib/util/unix_privs.c9
-rw-r--r--lib/util/util.c10
-rw-r--r--source3/lib/system.c1
-rw-r--r--source3/lib/util_sec.c2
-rw-r--r--source3/rpc_server/rpc_handles.c1
-rw-r--r--source3/rpc_server/srv_access_check.c1
-rw-r--r--source3/smbd/sec_ctx.c2
-rw-r--r--source4/ntvfs/posix/pvfs_acl.c10
-rw-r--r--source4/ntvfs/unixuid/vfs_unixuid.c10
12 files changed, 23 insertions, 43 deletions
diff --git a/lib/replace/system/passwd.h b/lib/replace/system/passwd.h
index aaea9c8344..f630012f00 100644
--- a/lib/replace/system/passwd.h
+++ b/lib/replace/system/passwd.h
@@ -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
diff --git a/lib/uid_wrapper/uid_wrapper.c b/lib/uid_wrapper/uid_wrapper.c
index c43dbc1436..898d1afbb9 100644
--- a/lib/uid_wrapper/uid_wrapper.c
+++ b/lib/uid_wrapper/uid_wrapper.c
@@ -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_ */
diff --git a/lib/uid_wrapper/uid_wrapper.h b/lib/uid_wrapper/uid_wrapper.h
index 7cb97af8df..680e544583 100644
--- a/lib/uid_wrapper/uid_wrapper.h
+++ b/lib/uid_wrapper/uid_wrapper.h
@@ -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__ */
diff --git a/lib/util/unix_privs.c b/lib/util/unix_privs.c
index 9aa9a45918..baa54fd558 100644
--- a/lib/util/unix_privs.c
+++ b/lib/util/unix_privs.c
@@ -23,15 +23,6 @@
#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
diff --git a/lib/util/util.c b/lib/util/util.c
index 133bd0dfb0..c7c37bc815 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -27,6 +27,7 @@
#include "system/filesys.h"
#include "system/locale.h"
#include "system/shmem.h"
+#include "system/passwd.h"
#undef malloc
#undef strcasecmp
@@ -34,15 +35,6 @@
#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
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 45fe77e344..85988417a6 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -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>
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index 0e2eee44af..60ea214d26 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -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 */
diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c
index 87145ca848..d547f18dc1 100644
--- a/source3/rpc_server/rpc_handles.c
+++ b/source3/rpc_server/rpc_handles.c
@@ -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"
diff --git a/source3/rpc_server/srv_access_check.c b/source3/rpc_server/srv_access_check.c
index 4e74b0443a..f667d7b23d 100644
--- a/source3/rpc_server/srv_access_check.c
+++ b/source3/rpc_server/srv_access_check.c
@@ -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"
diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c
index 446810d535..99592815e3 100644
--- a/source3/smbd/sec_ctx.c
+++ b/source3/smbd/sec_ctx.c
@@ -18,12 +18,12 @@
*/
#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;
diff --git a/source4/ntvfs/posix/pvfs_acl.c b/source4/ntvfs/posix/pvfs_acl.c
index 8157d862ec..b253b8ab2d 100644
--- a/source4/ntvfs/posix/pvfs_acl.c
+++ b/source4/ntvfs/posix/pvfs_acl.c
@@ -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"
@@ -28,15 +29,6 @@
#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;
diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c
index 0221b4391c..7e7fd443d5 100644
--- a/source4/ntvfs/unixuid/vfs_unixuid.c
+++ b/source4/ntvfs/unixuid/vfs_unixuid.c
@@ -29,16 +29,6 @@
#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 {