summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-06-23 22:30:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:42 -0500
commit66a52992ff6a9f2f926249ac428d6fad72303637 (patch)
tree125e49ba1f1f28a9f0e205482d250f344e9bbed0
parentf877a7fdf570db5c36c29eebc0e579f848e4a912 (diff)
downloadsamba-66a52992ff6a9f2f926249ac428d6fad72303637.tar.gz
samba-66a52992ff6a9f2f926249ac428d6fad72303637.tar.bz2
samba-66a52992ff6a9f2f926249ac428d6fad72303637.zip
r7850: Support mkdir() with just one parameter. Patch from
Steven Edwards <steven_ed4153@yahoo.com>. I've moved the Win32-specific tests to win32.m4 so it does not make any of the POSIX configure stuff more complicated. (This used to be commit bf85fdd01552f75b745fdf3159a7a87cd6521ed2)
-rw-r--r--source4/configure.in1
-rw-r--r--source4/include/system/dir.h3
-rw-r--r--source4/lib/messaging/messaging.c1
-rw-r--r--source4/lib/replace/win32.m420
-rw-r--r--source4/lib/util.c3
-rw-r--r--source4/ntvfs/posix/pvfs_mkdir.c1
-rw-r--r--source4/ntvfs/posix/pvfs_open.c1
-rw-r--r--source4/ntvfs/simple/vfs_simple.c1
-rw-r--r--source4/rpc_server/dcerpc_sock.c1
-rw-r--r--source4/winbind/wb_server.c1
10 files changed, 32 insertions, 1 deletions
diff --git a/source4/configure.in b/source4/configure.in
index 0155576443..0485f3885f 100644
--- a/source4/configure.in
+++ b/source4/configure.in
@@ -9,6 +9,7 @@ AC_CONFIG_HEADER(include/config.h)
sinclude(build/m4/env.m4)
sinclude(build/m4/rewrite.m4)
+sinclude(lib/replace/win32.m4)
sinclude(heimdal_build/config.m4)
sinclude(lib/popt/config.m4)
sinclude(lib/iconv.m4)
diff --git a/source4/include/system/dir.h b/source4/include/system/dir.h
index 14c0ba4f19..07a732e206 100644
--- a/source4/include/system/dir.h
+++ b/source4/include/system/dir.h
@@ -37,3 +37,6 @@
# endif
#endif
+#ifndef HAVE_MKDIR_MODE
+#define mkdir(dir, mode) mkdir(dir)
+#endif
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index 70eb2e7680..6209c36554 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "lib/events/events.h"
+#include "system/dir.h"
#include "system/filesys.h"
#include "system/time.h"
#include "messages.h"
diff --git a/source4/lib/replace/win32.m4 b/source4/lib/replace/win32.m4
new file mode 100644
index 0000000000..6b9c4e6b13
--- /dev/null
+++ b/source4/lib/replace/win32.m4
@@ -0,0 +1,20 @@
+AC_CHECK_HEADERS(direct.h)
+
+#######################################
+# Check for mkdir mode
+AC_CACHE_CHECK( [whether mkdir supports mode], ac_mkdir_has_mode,
+ AC_TRY_COMPILE([
+ #include <stdio.h>
+ #ifdef HAVE_DIRECT_H
+ #include <direct.h>
+ #endif],[
+ mkdir("foo",0777);
+ return 0;
+ ],
+ ac_mkdir_has_mode="yes",
+ ac_mkdir_has_mode="no") )
+
+if test "$ac_mkdir_has_mode" = "yes"
+then
+ AC_DEFINE(HAVE_MKDIR_MODE, 1, [Define if target mkdir supports mode option])
+fi
diff --git a/source4/lib/util.c b/source4/lib/util.c
index 59d83a966a..ba2c0e1ae4 100644
--- a/source4/lib/util.c
+++ b/source4/lib/util.c
@@ -26,9 +26,10 @@
#include "dynconfig.h"
#include "system/network.h"
#include "system/iconv.h"
+#include "system/dir.h"
#include "system/filesys.h"
-/**************************************************************************n
+/***************************************************************************
Find a suitable temporary directory. The result should be copied immediately
as it may be overwritten by a subsequent call.
****************************************************************************/
diff --git a/source4/ntvfs/posix/pvfs_mkdir.c b/source4/ntvfs/posix/pvfs_mkdir.c
index 03bc16cdbe..591ec7ca84 100644
--- a/source4/ntvfs/posix/pvfs_mkdir.c
+++ b/source4/ntvfs/posix/pvfs_mkdir.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "system/dir.h"
#include "vfs_posix.h"
#include "librpc/gen_ndr/ndr_security.h"
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index 4a2c8ea247..8dd9689863 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "vfs_posix.h"
+#include "system/dir.h"
#include "system/time.h"
#include "dlinklist.h"
#include "messages.h"
diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c
index cebf7a5c32..86ffab66ba 100644
--- a/source4/ntvfs/simple/vfs_simple.c
+++ b/source4/ntvfs/simple/vfs_simple.c
@@ -27,6 +27,7 @@
*/
#include "includes.h"
+#include "system/dir.h"
#include "system/filesys.h"
#include "svfs.h"
#include "system/time.h"
diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c
index 130f85c0ee..ab05a3b8b7 100644
--- a/source4/rpc_server/dcerpc_sock.c
+++ b/source4/rpc_server/dcerpc_sock.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "lib/socket/socket.h"
+#include "system/dir.h"
#include "system/filesys.h"
#include "lib/events/events.h"
#include "rpc_server/dcerpc_server.h"
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index 63d186f9dd..121aeb5a3a 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "lib/socket/socket.h"
+#include "system/dir.h"
#include "system/filesys.h"
#include "dlinklist.h"
#include "lib/events/events.h"