From 7b5fb7d9e88bf848173363f5a1e2a0f1db6c7293 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 8 Oct 2011 12:10:20 +0200 Subject: [PATCH] replace: Add don't include unistd.h directly and add uid_wrapper. --- lib/replace/system/filesys.h | 11 +++++++++++ lib/replace/system/network.h | 13 +++++++++++++ source3/lib/pthreadpool/pthreadpool.c | 2 +- source3/libsmb/smb_share_modes.c | 1 + source3/registry/reg_parse.c | 2 -- source4/lib/policy/gp_filesys.c | 4 +--- source4/libcli/smb2/session.c | 3 +-- source4/torture/rpc/samr.c | 3 +-- 8 files changed, 29 insertions(+), 10 deletions(-) diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h index 47ea4e40306..e2c3c1dd725 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 a4e6a7e31a6..7cb8d7becf4 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 + #ifdef HAVE_SYS_SOCKET_H #include #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 42b550d7ed7..c916dc0f8d5 100644 --- a/source3/lib/pthreadpool/pthreadpool.c +++ b/source3/lib/pthreadpool/pthreadpool.c @@ -20,7 +20,6 @@ #include "config.h" #include #include -#include #include #include #include @@ -28,6 +27,7 @@ #include #include #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 7c0a6d2a4e6..42640e0cea4 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 . */ +#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 f1258fca6d1..a112572b558 100644 --- a/source3/registry/reg_parse.c +++ b/source3/registry/reg_parse.c @@ -34,12 +34,10 @@ #include "reg_format.h" #include -#include #include #include #include #include -#include #include #include #include diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c index 55180cb78ed..17894a7072f 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 . */ #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 -#include -#include #include #include diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c index f30152329e9..74b8668462f 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 #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 - /** initialise a smb2_session structure */ diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index f7d6a93bb39..cc2cdfc3526 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -24,6 +24,7 @@ #include "torture/torture.h" #include #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 - #define TEST_ACCOUNT_NAME "samrtorturetest" #define TEST_ACCOUNT_NAME_PWD "samrpwdlastset" #define TEST_ALIASNAME "samrtorturetestalias" -- 2.11.4.GIT