diff options
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/include/smb.h | 5 | ||||
-rw-r--r-- | source3/include/vfs.h | 2 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 6 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 4 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 6 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 6 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 4 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 8 | ||||
-rw-r--r-- | source3/smbd/open.c | 12 | ||||
-rw-r--r-- | source3/smbd/posix_acls.c | 2 | ||||
-rw-r--r-- | source3/smbd/reply.c | 18 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 12 |
13 files changed, 46 insertions, 41 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 08ecbfd1e5..63fe4d47c5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -8114,7 +8114,7 @@ NTSTATUS create_file_default(connection_struct *conn, struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, diff --git a/source3/include/smb.h b/source3/include/smb.h index bcf605ee53..39673e1ff7 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 5f6851a7bc..383cd327ae 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -313,7 +313,7 @@ struct vfs_ops { struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 97107f3f60..fa5dad8781 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -48,7 +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, is_dos_path, 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), (is_dos_path), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf))) +#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))) @@ -174,7 +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, is_dos_path, 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), (is_dos_path), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf))) +#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))) @@ -301,7 +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, is_dos_path, 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), (is_dos_path), (access_mask), (share_access), (create_disposition), (create_options), (file_attributes), (oplock_request), (allocation_size), (sd), (ea_list), (result), (pinfo), (psbuf))) +#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 fde899d1af..6d8d8f8065 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -212,7 +212,7 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle, struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, @@ -227,7 +227,7 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct *handle, SMB_STRUCT_STAT *psbuf) { return create_file_default(handle->conn, req, root_dir_fid, fname, - is_dos_path, access_mask, share_access, + create_file_flags, access_mask, share_access, create_disposition, create_options, file_attributes, oplock_request, allocation_size, sd, ea_list, result, pinfo, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index fd97a4ccff..7970bf2644 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -113,7 +113,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle, struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, @@ -1110,7 +1110,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle, struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, @@ -1131,7 +1131,7 @@ static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle, req, /* req */ root_dir_fid, /* root_dir_fid */ fname, /* fname */ - is_dos_path, /* is_dos_path */ + create_file_flags, /* create_file_flags */ access_mask, /* access_mask */ share_access, /* share_access */ create_disposition, /* create_disposition*/ diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 0c54c6452a..ba1fb4352c 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1349,7 +1349,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr NULL, /* req */ 0, /* root_dir_fid */ filepath, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ FILE_OPEN, /* create_disposition*/ @@ -1400,7 +1400,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr NULL, /* req */ 0, /* root_dir_fid */ filepath, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ FILE_OPEN, /* create_disposition*/ @@ -1553,7 +1553,7 @@ static uint32 get_correct_cversion(struct pipes_struct *p, NULL, /* req */ 0, /* root_dir_fid */ driverpath, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ FILE_OPEN, /* create_disposition*/ diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index 0febfbca06..76b475120d 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -2053,7 +2053,7 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p, NULL, /* req */ 0, /* root_dir_fid */ r->in.file, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_READ|FILE_SHARE_WRITE, /* share_access */ FILE_OPEN, /* create_disposition*/ @@ -2168,7 +2168,7 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p, NULL, /* req */ 0, /* root_dir_fid */ r->in.file, /* fname */ - true, /* is_dos_path */ + 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 a7b2cb6c31..24a14a8c1b 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -479,7 +479,7 @@ void reply_ntcreate_and_X(struct smb_request *req) req, /* req */ root_dir_fid, /* root_dir_fid */ fname, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ access_mask, /* access_mask */ share_access, /* share_access */ create_disposition, /* create_disposition*/ @@ -951,7 +951,7 @@ static void call_nt_transact_create(connection_struct *conn, req, /* req */ root_dir_fid, /* root_dir_fid */ fname, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ access_mask, /* access_mask */ share_access, /* share_access */ create_disposition, /* create_disposition*/ @@ -1191,7 +1191,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, req, /* req */ 0, /* root_dir_fid */ oldname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_READ_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), @@ -1215,7 +1215,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, req, /* req */ 0, /* root_dir_fid */ newname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_WRITE_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d2068dde47..55aec16840 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2099,7 +2099,7 @@ NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn, NULL, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_WRITE_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), @@ -2464,7 +2464,7 @@ NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, cons req, /* req */ 0, /* root_dir_fid */ directory, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_NONE, /* share_access */ FILE_CREATE, /* create_disposition*/ @@ -3073,7 +3073,7 @@ NTSTATUS create_file_default(connection_struct *conn, struct smb_request *req, uint16_t root_dir_fid, const char *fname, - bool is_dos_path, + uint32_t create_file_flags, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, @@ -3099,7 +3099,7 @@ NTSTATUS create_file_default(connection_struct *conn, "create_disposition = 0x%x create_options = 0x%x " "oplock_request = 0x%x " "root_dir_fid = 0x%x, ea_list = 0x%p, sd = 0x%p, " - "is_dos_path = %s, fname = %s\n", + "create_file_flags = 0x%x, fname = %s\n", (unsigned int)access_mask, (unsigned int)file_attributes, (unsigned int)share_access, @@ -3107,7 +3107,7 @@ NTSTATUS create_file_default(connection_struct *conn, (unsigned int)create_options, (unsigned int)oplock_request, (unsigned int)root_dir_fid, - ea_list, sd, fname, is_dos_path ? "true" : "false")); + ea_list, sd, create_file_flags, fname)); /* * Get the file name. @@ -3263,7 +3263,7 @@ NTSTATUS create_file_default(connection_struct *conn, file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS; } - if (is_dos_path) { + if (create_file_flags & CFF_DOS_PATH) { char *converted_fname; SET_STAT_INVALID(sbuf); diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 78a5d548c2..b184279259 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -3253,7 +3253,7 @@ NTSTATUS append_parent_acl(files_struct *fsp, NULL, /* req */ 0, /* root_dir_fid */ parent_name, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_NONE, /* share_access */ FILE_OPEN, /* create_disposition*/ diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 728753bc3b..00c744ce1a 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1635,7 +1635,7 @@ void reply_open(struct smb_request *req) req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ access_mask, /* access_mask */ share_mode, /* share_access */ create_disposition, /* create_disposition*/ @@ -1781,7 +1781,7 @@ void reply_open_and_X(struct smb_request *req) req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ access_mask, /* access_mask */ share_mode, /* share_access */ create_disposition, /* create_disposition*/ @@ -1981,7 +1981,7 @@ void reply_mknew(struct smb_request *req) req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ access_mask, /* access_mask */ share_mode, /* share_access */ create_disposition, /* create_disposition*/ @@ -2128,7 +2128,7 @@ void reply_ctemp(struct smb_request *req) req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_GENERIC_READ | FILE_GENERIC_WRITE, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ FILE_OPEN, /* create_disposition*/ @@ -2330,7 +2330,7 @@ static NTSTATUS do_unlink(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ DELETE_ACCESS, /* access_mask */ FILE_SHARE_NONE, /* share_access */ FILE_OPEN, /* create_disposition*/ @@ -5764,7 +5764,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, req, /* req */ 0, /* root_dir_fid */ directory, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ access_mask, /* access_mask */ (FILE_SHARE_READ | /* share_access */ FILE_SHARE_WRITE), @@ -5882,7 +5882,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ access_mask, /* access_mask */ (FILE_SHARE_READ | /* share_access */ FILE_SHARE_WRITE), @@ -6094,7 +6094,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx, NULL, /* req */ 0, /* root_dir_fid */ src, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_GENERIC_READ, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ FILE_OPEN, /* create_disposition*/ @@ -6123,7 +6123,7 @@ NTSTATUS copy_file(TALLOC_CTX *ctx, NULL, /* req */ 0, /* root_dir_fid */ dest, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_GENERIC_WRITE, /* access_mask */ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share_access */ new_create_disposition, /* create_disposition*/ diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index b9a04e9b4f..f41210b2e1 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1011,7 +1011,7 @@ static void call_trans2open(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - true, /* is_dos_path */ + CFF_DOS_PATH, /* create_file_flags */ access_mask, /* access_mask */ share_mode, /* share_access */ create_disposition, /* create_disposition*/ @@ -5064,7 +5064,7 @@ static NTSTATUS smb_set_file_size(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_WRITE_ATTRIBUTES, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), @@ -5844,7 +5844,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_WRITE_DATA, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), @@ -6286,7 +6286,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ FILE_READ_ATTRIBUTES, /* access_mask */ FILE_SHARE_NONE, /* share_access */ FILE_CREATE, /* create_disposition*/ @@ -6460,7 +6460,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ access_mask, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), @@ -6590,7 +6590,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, req, /* req */ 0, /* root_dir_fid */ fname, /* fname */ - false, /* is_dos_path */ + 0, /* create_file_flags */ DELETE_ACCESS, /* access_mask */ (FILE_SHARE_READ | FILE_SHARE_WRITE | /* share_access */ FILE_SHARE_DELETE), |