replace: Add don't include unistd.h directly and add uid_wrapper.
authorAndreas Schneider <asn@samba.org>
Sat, 8 Oct 2011 10:10:20 +0000 (12:10 +0200)
committerAndreas Schneider <asn@samba.org>
Thu, 27 Oct 2011 11:32:02 +0000 (13:32 +0200)
lib/replace/system/filesys.h
lib/replace/system/network.h
source3/lib/pthreadpool/pthreadpool.c
source3/libsmb/smb_share_modes.c
source3/registry/reg_parse.c
source4/lib/policy/gp_filesys.c
source4/libcli/smb2/session.c
source4/torture/rpc/samr.c

index 47ea4e4030676bec827f76baa35b393307d5ee1e..e2c3c1dd7250896ae04014ef74442f07c9218d43 100644 (file)
 #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
index a4e6a7e31a60e4430a439957c7fb2f9f120e7d53..7cb8d7becf45c13747d7a858cad48e99d0b4e432 100644 (file)
@@ -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
index 42b550d7ed7567f0b7d2f636481f008f871e90cb..c916dc0f8d5ca1dc0f112c310a1f8d676386e5fd 100644 (file)
@@ -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"
index 7c0a6d2a4e67b046e9641d6dffe89cbaf7f6176b..42640e0cea46a7ed043ee0e90a21dacdbee86da4 100644 (file)
@@ -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"
index f1258fca6d1db7bcacd8441ce59c6c16b1546b89..a112572b558504f4d0d2f4c80f10f7b545aac5b7 100644 (file)
 #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>
index 55180cb78ed03ce7c436a58d5a1c158bb67509b9..17894a7072f151ec4e79e6ccdf115327bc429af1 100644 (file)
  *  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>
 
index f30152329e91ca411a0c318dda3592cb886c6189..74b8668462f70b72e6bae3549a5a3d30093e66d7 100644 (file)
@@ -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
  */
index f7d6a93bb39f62bdc2e6cc21d79a43ea12c61315..cc2cdfc3526522ad9f27772f08afc1a996101d76 100644 (file)
@@ -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"