summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/replace/system/filesys.h11
-rw-r--r--lib/replace/system/network.h13
-rw-r--r--source3/lib/pthreadpool/pthreadpool.c2
-rw-r--r--source3/libsmb/smb_share_modes.c1
-rw-r--r--source3/registry/reg_parse.c2
-rw-r--r--source4/lib/policy/gp_filesys.c4
-rw-r--r--source4/libcli/smb2/session.c3
-rw-r--r--source4/torture/rpc/samr.c3
8 files changed, 29 insertions, 10 deletions
diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h
index 47ea4e4030..e2c3c1dd72 100644
--- a/lib/replace/system/filesys.h
+++ b/lib/replace/system/filesys.h
@@ -189,4 +189,15 @@
#define mkdir(d,m) _mkdir(d)
#endif
+#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/replace/system/network.h b/lib/replace/system/network.h
index a4e6a7e31a..7cb8d7becf 100644
--- a/lib/replace/system/network.h
+++ b/lib/replace/system/network.h
@@ -31,6 +31,8 @@
#error "AC_LIBREPLACE_NETWORK_CHECKS missing in configure"
#endif
+#include <unistd.h>
+
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
@@ -374,4 +376,15 @@ struct addrinfo {
#endif /* SOCKET_WRAPPER_DISABLE */
#endif /* SOCKET_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/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index 42b550d7ed..c916dc0f8d 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -20,7 +20,6 @@
#include "config.h"
#include <errno.h>
#include <stdio.h>
-#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
@@ -28,6 +27,7 @@
#include <assert.h>
#include <fcntl.h>
#include "system/time.h"
+#include "system/filesys.h"
#include "pthreadpool.h"
#include "lib/util/dlinklist.h"
diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c
index 7c0a6d2a4e..42640e0cea 100644
--- a/source3/libsmb/smb_share_modes.c
+++ b/source3/libsmb/smb_share_modes.c
@@ -24,6 +24,7 @@
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+#define UID_WRAPPER_NOT_REPLACE
#include "includes.h"
#include "system/filesys.h"
#include "smb_share_modes.h"
diff --git a/source3/registry/reg_parse.c b/source3/registry/reg_parse.c
index f1258fca6d..a112572b55 100644
--- a/source3/registry/reg_parse.c
+++ b/source3/registry/reg_parse.c
@@ -34,12 +34,10 @@
#include "reg_format.h"
#include <stdio.h>
-#include <unistd.h>
#include <wchar.h>
#include <talloc.h>
#include <stdbool.h>
#include <string.h>
-#include <sys/types.h>
#include <regex.h>
#include <assert.h>
#include <stdint.h>
diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c
index 55180cb78e..17894a7072 100644
--- a/source4/lib/policy/gp_filesys.c
+++ b/source4/lib/policy/gp_filesys.c
@@ -17,15 +17,13 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
+#include "system/filesys.h"
#include "lib/policy/policy.h"
#include "libcli/raw/smb.h"
#include "libcli/libcli.h"
#include "param/param.h"
#include "libcli/resolve/resolve.h"
#include "libcli/raw/libcliraw.h"
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
#include <dirent.h>
#include <errno.h>
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c
index f30152329e..74b8668462 100644
--- a/source4/libcli/smb2/session.c
+++ b/source4/libcli/smb2/session.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "system/network.h"
#include <tevent.h>
#include "lib/util/tevent_ntstatus.h"
#include "libcli/raw/libcliraw.h"
@@ -27,8 +28,6 @@
#include "libcli/smb2/smb2_calls.h"
#include "auth/gensec/gensec.h"
-#include <unistd.h>
-
/**
initialise a smb2_session structure
*/
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index f7d6a93bb3..cc2cdfc352 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -24,6 +24,7 @@
#include "torture/torture.h"
#include <tevent.h>
#include "system/time.h"
+#include "system/network.h"
#include "librpc/gen_ndr/lsa.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "librpc/gen_ndr/ndr_netlogon_c.h"
@@ -39,8 +40,6 @@
#include "auth/gensec/gensec_proto.h"
#include "../libcli/auth/schannel.h"
-#include <unistd.h>
-
#define TEST_ACCOUNT_NAME "samrtorturetest"
#define TEST_ACCOUNT_NAME_PWD "samrpwdlastset"
#define TEST_ALIASNAME "samrtorturetestalias"