[SCM] Samba Shared Repository - branch master updated - dbfcd3f97c02a19c48360b4f477570997f8aa870

Tim Prouty tprouty at samba.org
Thu Dec 4 02:02:36 GMT 2008


The branch, master has been updated
       via  dbfcd3f97c02a19c48360b4f477570997f8aa870 (commit)
       via  58440122853b65048793efd90ee45916e25c08c1 (commit)
       via  f79aae70dd10877311243b5b2a55e1f130bd54b6 (commit)
       via  6f7f4b428a86921e9532c62856873a19202f286d (commit)
       via  08ce0604757315367f26a2c0869d59dd229c3ffe (commit)
       via  2caa4fe08e157a01012b425a68cc25c381d5f354 (commit)
       via  61b4597e3c9016b3fdd540857abf3b72963ad4b2 (commit)
       via  f995a7af2a06ccff29f23f1b099e0a84bc948f6e (commit)
       via  f38d7f20a865b1ff5f7b039dd284d91b2ba7ec26 (commit)
      from  1eb743ab8e8b1141f99fabd3e4a46895c6dcc17e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit dbfcd3f97c02a19c48360b4f477570997f8aa870
Author: Tim Prouty <tprouty at samba.org>
Date:   Mon Dec 1 14:13:14 2008 -0800

    s3: Fix FILE_FLAG_POSIX_SEMANTICS handling underneath SMB_VFS_CREATE_FILE

commit 58440122853b65048793efd90ee45916e25c08c1
Author: Tim Prouty <tprouty at samba.org>
Date:   Mon Dec 1 12:47:31 2008 -0800

    s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argument
    
    This replaces the is_dos_path bool with a more future-proof argument.
    The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead
    of overridding the oplock_request.

commit f79aae70dd10877311243b5b2a55e1f130bd54b6
Author: Tim Prouty <tprouty at samba.org>
Date:   Sat Nov 22 19:40:09 2008 -0800

    s3: Simplify the create_file_unix_path->open_file_ntcreate path
    
    Also removed open_file_ntcreate/open_file from proto.h so they can no
    longer be called directly.

commit 6f7f4b428a86921e9532c62856873a19202f286d
Author: Tim Prouty <tprouty at samba.org>
Date:   Sat Nov 22 19:37:24 2008 -0800

    s3: Modify direct caller of open_file to call SMB_VFS_CREATE_FILE

commit 08ce0604757315367f26a2c0869d59dd229c3ffe
Author: Tim Prouty <tprouty at samba.org>
Date:   Thu Nov 20 18:55:24 2008 -0800

    s3: Modify direct callers of open_file_ntcreate and open_directory to call SMB_VFS_CREATE_FILE

commit 2caa4fe08e157a01012b425a68cc25c381d5f354
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Nov 19 18:03:27 2008 -0800

    s3: Modify direct callers of create_file_unix_path to call SMB_VFS_CREATE_FILE

commit 61b4597e3c9016b3fdd540857abf3b72963ad4b2
Author: Tim Prouty <tprouty at samba.org>
Date:   Sun Nov 23 14:37:37 2008 -0800

    s3: Add SMB_VFS_CREATE_FILE to vfs_full_audit module

commit f995a7af2a06ccff29f23f1b099e0a84bc948f6e
Author: Tim Prouty <tprouty at samba.org>
Date:   Wed Nov 19 17:55:28 2008 -0800

    s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILE
    
    Now unix paths can be differentiated from windows paths so the
    underlying create_file implementations can convert paths correctly.

commit f38d7f20a865b1ff5f7b039dd284d91b2ba7ec26
Author: Tim Prouty <tprouty at samba.org>
Date:   Mon Oct 20 17:43:45 2008 -0700

    s3: Add SMB_VFS_CREATE_FILE to the vfs layer
    
    Modify all callers of create_file to go through SMB_VFS_CREATE_FILE

-----------------------------------------------------------------------

Summary of changes:
 source3/include/proto.h            |   75 +++-------
 source3/include/smb.h              |    5 +
 source3/include/vfs.h              |   22 +++
 source3/include/vfs_macros.h       |    3 +
 source3/modules/vfs_default.c      |   28 ++++
 source3/modules/vfs_full_audit.c   |   64 ++++++++
 source3/printing/nt_printing.c     |   78 +++++++---
 source3/rpc_server/srv_srvsvc_nt.c |    6 +-
 source3/smbd/nttrans.c             |   98 ++++++++++---
 source3/smbd/open.c                |  283 ++++++++++++++++++------------------
 source3/smbd/posix_acls.c          |   29 +++--
 source3/smbd/reply.c               |  259 ++++++++++++++++++++------------
 source3/smbd/trans2.c              |  195 +++++++++++++++----------
 13 files changed, 709 insertions(+), 436 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index d9430e2..63fe4d4 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -8100,73 +8100,34 @@ bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func
 				 uint32 *pshare_mode,
 				 uint32 *pcreate_disposition,
 				 uint32 *pcreate_options);
-NTSTATUS open_file_ntcreate(connection_struct *conn,
-			    struct smb_request *req,
-			    const char *fname,
-			    SMB_STRUCT_STAT *psbuf,
-			    uint32 access_mask,		/* access bits (FILE_READ_DATA etc.) */
-			    uint32 share_access,	/* share constants (FILE_SHARE_READ etc) */
-			    uint32 create_disposition,	/* FILE_OPEN_IF etc. */
-			    uint32 create_options,	/* options such as delete on close. */
-			    uint32 new_dos_attributes,	/* attributes used for new file. */
-			    int oplock_request, 	/* internal Samba oplock codes. */
-				 			/* Information (FILE_EXISTS etc.) */
-			    int *pinfo,
-			    files_struct **result);
 NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn,
 			  const char *fname,
 			  SMB_STRUCT_STAT *psbuf, files_struct **result);
 NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp);
-NTSTATUS open_directory(connection_struct *conn,
-			struct smb_request *req,
-			const char *fname,
-			SMB_STRUCT_STAT *psbuf,
-			uint32 access_mask,
-			uint32 share_access,
-			uint32 create_disposition,
-			uint32 create_options,
-			uint32 file_attributes,
-			int *pinfo,
-			files_struct **result);
 NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, const char *directory);
 void msg_file_was_renamed(struct messaging_context *msg,
 			  void *private_data,
 			  uint32_t msg_type,
 			  struct server_id server_id,
 			  DATA_BLOB *data);
-NTSTATUS create_file_unixpath(connection_struct *conn,
-			      struct smb_request *req,
-			      const char *fname,
-			      uint32_t access_mask,
-			      uint32_t share_access,
-			      uint32_t create_disposition,
-			      uint32_t create_options,
-			      uint32_t file_attributes,
-			      uint32_t oplock_request,
-			      uint64_t allocation_size,
-			      struct security_descriptor *sd,
-			      struct ea_list *ea_list,
-
-			      files_struct **result,
-			      int *pinfo,
-			      SMB_STRUCT_STAT *psbuf);
-NTSTATUS create_file(connection_struct *conn,
-		     struct smb_request *req,
-		     uint16_t root_dir_fid,
-		     const char *fname,
-		     uint32_t access_mask,
-		     uint32_t share_access,
-		     uint32_t create_disposition,
-		     uint32_t create_options,
-		     uint32_t file_attributes,
-		     uint32_t oplock_request,
-		     uint64_t allocation_size,
-		     struct security_descriptor *sd,
-		     struct ea_list *ea_list,
-
-		     files_struct **result,
-		     int *pinfo,
-		     SMB_STRUCT_STAT *psbuf);
+NTSTATUS create_file_default(connection_struct *conn,
+			     struct smb_request *req,
+			     uint16_t root_dir_fid,
+			     const char *fname,
+			     uint32_t create_file_flags,
+			     uint32_t access_mask,
+			     uint32_t share_access,
+			     uint32_t create_disposition,
+			     uint32_t create_options,
+			     uint32_t file_attributes,
+			     uint32_t oplock_request,
+			     uint64_t allocation_size,
+			     struct security_descriptor *sd,
+			     struct ea_list *ea_list,
+
+			     files_struct **result,
+			     int *pinfo,
+			     SMB_STRUCT_STAT *psbuf);
 
 /* The following definitions come from smbd/oplock.c  */
 
diff --git a/source3/include/smb.h b/source3/include/smb.h
index bcf605e..39673e1 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1895,4 +1895,9 @@ struct smb_extended_info {
 	char   samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
 };
 
+/*
+ * create_file_flags
+ */
+#define CFF_DOS_PATH		0x00000001
+
 #endif /* _SMB_H */
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 4cedb4a..383cd32 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -110,6 +110,7 @@
    open handle. JRA. */
 /* Changed to version 24 - make security descriptor const in fset_nt_acl. JRA. */
 /* Changed to version 25 - Jelmer's change from SMB_BIG_UINT to uint64_t. */
+/* Leave at 25 - not yet released. Add create_file call. -- tprouty. */
 
 #define SMB_VFS_INTERFACE_VERSION 25
 
@@ -134,6 +135,8 @@ struct connection_struct;
 struct files_struct;
 struct security_descriptor;
 struct vfs_statvfs_struct;
+struct smb_request;
+struct ea_list;
 
 /*
     Available VFS operations. These values must be in sync with vfs_ops struct
@@ -170,6 +173,7 @@ typedef enum _vfs_op_type {
 	/* File operations */
 
 	SMB_VFS_OP_OPEN,
+	SMB_VFS_OP_CREATE_FILE,
 	SMB_VFS_OP_CLOSE,
 	SMB_VFS_OP_READ,
 	SMB_VFS_OP_PREAD,
@@ -305,6 +309,23 @@ struct vfs_ops {
 		/* File operations */
 
 		int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode);
+		NTSTATUS (*create_file)(struct vfs_handle_struct *handle,
+					struct smb_request *req,
+					uint16_t root_dir_fid,
+					const char *fname,
+					uint32_t create_file_flags,
+					uint32_t access_mask,
+					uint32_t share_access,
+					uint32_t create_disposition,
+					uint32_t create_options,
+					uint32_t file_attributes,
+					uint32_t oplock_request,
+					uint64_t allocation_size,
+					struct security_descriptor *sd,
+					struct ea_list *ea_list,
+					files_struct **result,
+					int *pinfo,
+					SMB_STRUCT_STAT *psbuf);
 		int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp);
 		ssize_t (*vfs_read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n);
 		ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset);
@@ -452,6 +473,7 @@ struct vfs_ops {
 		/* File operations */
 
 		struct vfs_handle_struct *open;
+		struct vfs_handle_struct *create_file;
 		struct vfs_handle_struct *close_hnd;
 		struct vfs_handle_struct *vfs_read;
 		struct vfs_handle_struct *pread;
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 8fbc21b..fa5dad8 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -48,6 +48,7 @@
 
 /* File operations */
 #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs.ops.open)((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode)))
+#define SMB_VFS_CREATE_FILE(conn, req, root_dir_fid, fname, create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, psbuf) (((conn)->vfs.ops.create_file)((conn)->vfs.handles.create_file, (req), (root_dir_fid), (fname), (create_file_flags), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf)))
 #define SMB_VFS_CLOSE(fsp) ((fsp)->conn->vfs.ops.close_fn((fsp)->conn->vfs.handles.close_hnd, (fsp)))
 #define SMB_VFS_READ(fsp, data, n) ((fsp)->conn->vfs.ops.vfs_read((fsp)->conn->vfs.handles.vfs_read, (fsp), (data), (n)))
 #define SMB_VFS_PREAD(fsp, data, n, off) ((fsp)->conn->vfs.ops.pread((fsp)->conn->vfs.handles.pread, (fsp), (data), (n), (off)))
@@ -173,6 +174,7 @@
 
 /* File operations */
 #define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs_opaque.ops.open)((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode)))
+#define SMB_VFS_OPAQUE_CREATE_FILE(conn, req, root_dir_fid, fname, create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, psbuf) (((conn)->vfs_opaque.ops.create_file)((conn)->vfs_opaque.handles.create_file, (req), (root_dir_fid), (fname), (create_file_flags), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf)))
 #define SMB_VFS_OPAQUE_CLOSE(fsp) ((fsp)->conn->vfs_opaque.ops.close_fn((fsp)->conn->vfs_opaque.handles.close_hnd, (fsp)))
 #define SMB_VFS_OPAQUE_READ(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.vfs_read((fsp)->conn->vfs_opaque.handles.vfs_read, (fsp), (data), (n)))
 #define SMB_VFS_OPAQUE_PREAD(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pread((fsp)->conn->vfs_opaque.handles.pread, (fsp), (data), (n), (off)))
@@ -299,6 +301,7 @@
 
 /* File operations */
 #define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) (((handle)->vfs_next.ops.open)((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode)))
+#define SMB_VFS_NEXT_CREATE_FILE(handle, req, root_dir_fid, fname, create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, psbuf) (((handle)->vfs_next.ops.create_file)((handle)->vfs_next.handles.create_file, (req), (root_dir_fid), (fname), (create_file_flags), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf)))
 #define SMB_VFS_NEXT_CLOSE(handle, fsp) ((handle)->vfs_next.ops.close_fn((handle)->vfs_next.handles.close_hnd, (fsp)))
 #define SMB_VFS_NEXT_READ(handle, fsp, data, n) ((handle)->vfs_next.ops.vfs_read((handle)->vfs_next.handles.vfs_read, (fsp), (data), (n)))
 #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pread((handle)->vfs_next.handles.pread, (fsp), (data), (n), (off)))
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index d972828..6d8d8f8 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -208,6 +208,32 @@ static int vfswrap_open(vfs_handle_struct *handle,  const char *fname,
 	return result;
 }
 
+static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle,
+				    struct smb_request *req,
+				    uint16_t root_dir_fid,
+				    const char *fname,
+				    uint32_t create_file_flags,
+				    uint32_t access_mask,
+				    uint32_t share_access,
+				    uint32_t create_disposition,
+				    uint32_t create_options,
+				    uint32_t file_attributes,
+				    uint32_t oplock_request,
+				    uint64_t allocation_size,
+				    struct security_descriptor *sd,
+				    struct ea_list *ea_list,
+				    files_struct **result,
+				    int *pinfo,
+				    SMB_STRUCT_STAT *psbuf)
+{
+	return create_file_default(handle->conn, req, root_dir_fid, fname,
+				   create_file_flags, access_mask, share_access,
+				   create_disposition, create_options,
+				   file_attributes, oplock_request,
+				   allocation_size, sd, ea_list, result, pinfo,
+				   psbuf);
+}
+
 static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp)
 {
 	int result;
@@ -1359,6 +1385,8 @@ static vfs_op_tuple vfs_default_ops[] = {
 
 	{SMB_VFS_OP(vfswrap_open),	SMB_VFS_OP_OPEN,
 	 SMB_VFS_LAYER_OPAQUE},
+	{SMB_VFS_OP(vfswrap_create_file),	SMB_VFS_OP_CREATE_FILE,
+	 SMB_VFS_LAYER_OPAQUE},
 	{SMB_VFS_OP(vfswrap_close),	SMB_VFS_OP_CLOSE,
 	 SMB_VFS_LAYER_OPAQUE},
 	{SMB_VFS_OP(vfswrap_read),	SMB_VFS_OP_READ,
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 6342c4a..7970bf2 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -109,6 +109,23 @@ static int smb_full_audit_closedir(vfs_handle_struct *handle,
 			  SMB_STRUCT_DIR *dirp);
 static int smb_full_audit_open(vfs_handle_struct *handle,
 		      const char *fname, files_struct *fsp, int flags, mode_t mode);
+static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
+				      struct smb_request *req,
+				      uint16_t root_dir_fid,
+				      const char *fname,
+				      uint32_t create_file_flags,
+				      uint32_t access_mask,
+				      uint32_t share_access,
+				      uint32_t create_disposition,
+				      uint32_t create_options,
+				      uint32_t file_attributes,
+				      uint32_t oplock_request,
+				      uint64_t allocation_size,
+				      struct security_descriptor *sd,
+				      struct ea_list *ea_list,
+				      files_struct **result,
+				      int *pinfo,
+				      SMB_STRUCT_STAT *psbuf);
 static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp);
 static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
 			  void *data, size_t n);
@@ -353,6 +370,8 @@ static vfs_op_tuple audit_op_tuples[] = {
 
 	{SMB_VFS_OP(smb_full_audit_open),	SMB_VFS_OP_OPEN,
 	 SMB_VFS_LAYER_LOGGER},
+	{SMB_VFS_OP(smb_full_audit_create_file),SMB_VFS_OP_CREATE_FILE,
+	 SMB_VFS_LAYER_LOGGER},
 	{SMB_VFS_OP(smb_full_audit_close),	SMB_VFS_OP_CLOSE,
 	 SMB_VFS_LAYER_LOGGER},
 	{SMB_VFS_OP(smb_full_audit_read),	SMB_VFS_OP_READ,
@@ -1087,6 +1106,51 @@ static int smb_full_audit_open(vfs_handle_struct *handle,
 	return result;
 }
 
+static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
+				      struct smb_request *req,
+				      uint16_t root_dir_fid,
+				      const char *fname,
+				      uint32_t create_file_flags,
+				      uint32_t access_mask,
+				      uint32_t share_access,
+				      uint32_t create_disposition,
+				      uint32_t create_options,
+				      uint32_t file_attributes,
+				      uint32_t oplock_request,
+				      uint64_t allocation_size,
+				      struct security_descriptor *sd,
+				      struct ea_list *ea_list,
+				      files_struct **result_fsp,
+				      int *pinfo,
+				      SMB_STRUCT_STAT *psbuf)
+{
+	NTSTATUS result;
+
+	result = SMB_VFS_NEXT_CREATE_FILE(
+		handle,					/* handle */
+		req,					/* req */
+		root_dir_fid,				/* root_dir_fid */
+		fname,					/* fname */
+		create_file_flags,			/* create_file_flags */
+		access_mask,				/* access_mask */
+		share_access,				/* share_access */
+		create_disposition,			/* create_disposition*/
+		create_options,				/* create_options */
+		file_attributes,			/* file_attributes */
+		oplock_request,				/* oplock_request */
+		allocation_size,			/* allocation_size */
+		sd,					/* sd */
+		ea_list,				/* ea_list */
+		result_fsp,				/* result */
+		pinfo,					/* pinfo */
+		psbuf);					/* psbuf */
+
+	do_log(SMB_VFS_OP_CREATE_FILE, (NT_STATUS_IS_OK(result)), handle, "0x%x|%s",
+	       access_mask, fname);
+
+	return result;
+}
+
 static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp)
 {
 	int result;
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 244b3ae..ba1fb43 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1344,14 +1344,24 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
 		goto error_exit;
 	}
 
-	status = open_file_ntcreate(conn, NULL, filepath, &stat_buf,
-				FILE_GENERIC_READ,
-				FILE_SHARE_READ|FILE_SHARE_WRITE,
-				FILE_OPEN,
-				0,
-				FILE_ATTRIBUTE_NORMAL,
-				INTERNAL_OPEN_ONLY,
-				NULL, &fsp);
+	status = SMB_VFS_CREATE_FILE(
+		conn,					/* conn */
+		NULL,					/* req */
+		0,					/* root_dir_fid */
+		filepath,				/* fname */
+		0,					/* create_file_flags */
+		FILE_GENERIC_READ,			/* access_mask */
+		FILE_SHARE_READ | FILE_SHARE_WRITE,	/* share_access */
+		FILE_OPEN,				/* create_disposition*/
+		0,					/* create_options */
+		FILE_ATTRIBUTE_NORMAL,			/* file_attributes */
+		INTERNAL_OPEN_ONLY,			/* oplock_request */
+		0,					/* allocation_size */
+		NULL,					/* sd */
+		NULL,					/* ea_list */
+		&fsp,					/* result */
+		NULL,					/* pinfo */
+		&stat_buf);				/* psbuf */
 
 	if (!NT_STATUS_IS_OK(status)) {
 		/* Old file not found, so by definition new file is in fact newer */
@@ -1385,14 +1395,24 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
 		goto error_exit;
 	}
 
-	status = open_file_ntcreate(conn, NULL, filepath, &stat_buf,
-				FILE_GENERIC_READ,
-				FILE_SHARE_READ|FILE_SHARE_WRITE,
-				FILE_OPEN,
-				0,
-				FILE_ATTRIBUTE_NORMAL,
-				INTERNAL_OPEN_ONLY,
-				NULL, &fsp);
+	status = SMB_VFS_CREATE_FILE(
+		conn,					/* conn */
+		NULL,					/* req */
+		0,					/* root_dir_fid */
+		filepath,				/* fname */
+		0,					/* create_file_flags */
+		FILE_GENERIC_READ,			/* access_mask */
+		FILE_SHARE_READ | FILE_SHARE_WRITE,	/* share_access */
+		FILE_OPEN,				/* create_disposition*/
+		0,					/* create_options */
+		FILE_ATTRIBUTE_NORMAL,			/* file_attributes */
+		INTERNAL_OPEN_ONLY,			/* oplock_request */
+		0,					/* allocation_size */
+		NULL,					/* sd */
+		NULL,					/* ea_list */
+		&fsp,					/* result */
+		NULL,					/* pinfo */
+		&stat_buf);				/* psbuf */
 
 	if (!NT_STATUS_IS_OK(status)) {
 		/* New file not found, this shouldn't occur if the caller did its job */
@@ -1528,14 +1548,24 @@ static uint32 get_correct_cversion(struct pipes_struct *p,
 		goto error_exit;
 	}
 
-	status = open_file_ntcreate(conn, NULL, driverpath, &st,
-				FILE_GENERIC_READ,
-				FILE_SHARE_READ|FILE_SHARE_WRITE,
-				FILE_OPEN,
-				0,
-				FILE_ATTRIBUTE_NORMAL,
-				INTERNAL_OPEN_ONLY,
-				NULL, &fsp);
+	status = SMB_VFS_CREATE_FILE(
+		conn,					/* conn */
+		NULL,					/* req */
+		0,					/* root_dir_fid */
+		driverpath,				/* fname */
+		0,					/* create_file_flags */
+		FILE_GENERIC_READ,			/* access_mask */
+		FILE_SHARE_READ | FILE_SHARE_WRITE,	/* share_access */
+		FILE_OPEN,				/* create_disposition*/
+		0,					/* create_options */
+		FILE_ATTRIBUTE_NORMAL,			/* file_attributes */
+		INTERNAL_OPEN_ONLY,			/* oplock_request */
+		0,					/* allocation_size */
+		NULL,					/* sd */
+		NULL,					/* ea_list */
+		&fsp,					/* result */
+		NULL,					/* pinfo */
+		&st);					/* psbuf */
 
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(3,("get_correct_cversion: Can't open file [%s], errno = %d\n",
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index bf36690..76b4751 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -2048,11 +2048,12 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
 		goto error_exit;
 	}
 
-	nt_status = create_file(
+	nt_status = SMB_VFS_CREATE_FILE(
 		conn,					/* conn */
 		NULL,					/* req */
 		0,					/* root_dir_fid */
 		r->in.file,				/* fname */
+		CFF_DOS_PATH,				/* create_file_flags */
 		FILE_READ_ATTRIBUTES,			/* access_mask */
 		FILE_SHARE_READ|FILE_SHARE_WRITE,	/* share_access */
 		FILE_OPEN,				/* create_disposition*/
@@ -2162,11 +2163,12 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
 		goto error_exit;
 	}
 
-	nt_status = create_file(
+	nt_status = SMB_VFS_CREATE_FILE(
 		conn,					/* conn */
 		NULL,					/* req */
 		0,					/* root_dir_fid */
 		r->in.file,				/* fname */
+		CFF_DOS_PATH,				/* create_file_flags */
 		FILE_WRITE_ATTRIBUTES,			/* access_mask */
 		FILE_SHARE_READ|FILE_SHARE_WRITE,	/* share_access */
 		FILE_OPEN,				/* create_disposition*/
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 777073e..24a14a8 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -474,10 +474,24 @@ void reply_ntcreate_and_X(struct smb_request *req)
 			? BATCH_OPLOCK : 0;
 	}
 
-	status = create_file(conn, req, root_dir_fid, fname,
-			     access_mask, share_access, create_disposition,
-			     create_options, file_attributes, oplock_request,
-			     allocation_size, NULL, NULL, &fsp, &info, &sbuf);
+	status = SMB_VFS_CREATE_FILE(
+		conn,					/* conn */
+		req,					/* req */
+		root_dir_fid,				/* root_dir_fid */
+		fname,					/* fname */
+		CFF_DOS_PATH,				/* create_file_flags */
+		access_mask,				/* access_mask */
+		share_access,				/* share_access */
+		create_disposition,			/* create_disposition*/
+		create_options,				/* create_options */
+		file_attributes,			/* file_attributes */
+		oplock_request,				/* oplock_request */
+		allocation_size,			/* allocation_size */
+		NULL,					/* sd */
+		NULL,					/* ea_list */
+		&fsp,					/* result */
+		&info,					/* pinfo */
+		&sbuf);					/* psbuf */
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list