summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2008-11-19 18:03:27 -0800
committerTim Prouty <tprouty@samba.org>2008-12-03 17:51:07 -0800
commit2caa4fe08e157a01012b425a68cc25c381d5f354 (patch)
tree5e7a388e6d43f215b3ce25244b988d35f34c43bc /source3/smbd/open.c
parent61b4597e3c9016b3fdd540857abf3b72963ad4b2 (diff)
downloadsamba-2caa4fe08e157a01012b425a68cc25c381d5f354.tar.gz
samba-2caa4fe08e157a01012b425a68cc25c381d5f354.tar.bz2
samba-2caa4fe08e157a01012b425a68cc25c381d5f354.zip
s3: Modify direct callers of create_file_unix_path to call SMB_VFS_CREATE_FILE
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c58
1 files changed, 42 insertions, 16 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index d8f5548883..989024f553 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -29,6 +29,23 @@ struct deferred_open_record {
struct file_id id;
};
+static 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);
+
/****************************************************************************
SMB1 file varient of se_access_check. Never test FILE_READ_ATTRIBUTES.
****************************************************************************/
@@ -2708,22 +2725,22 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn,
* Wrapper around open_file_ntcreate and open_directory
*/
-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)
+static 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)
{
SMB_STRUCT_STAT sbuf;
int info = FILE_WAS_OPENED;
@@ -3287,6 +3304,15 @@ NTSTATUS create_file_default(connection_struct *conn,
goto fail;
}
fname = converted_fname;
+ } else {
+ if (psbuf != NULL) {
+ sbuf = *psbuf;
+ } else {
+ if (SMB_VFS_STAT(conn, fname, &sbuf) == -1) {
+ SET_STAT_INVALID(sbuf);
+ }
+ }
+
}
TALLOC_FREE(case_state);