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.
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,
char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH];
};
+/*
+ * create_file_flags
+ */
+#define CFF_DOS_PATH 0x00000001
+
#endif /* _SMB_H */
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,
/* 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)))
/* 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)))
/* 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)))
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,
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,
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,
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,
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*/
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*/
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*/
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*/
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*/
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*/
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*/
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*/
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),
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),
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),
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*/
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,
"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,
(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.
file_attributes &= ~FILE_FLAG_POSIX_SEMANTICS;
}
- if (is_dos_path) {
+ if (create_file_flags & CFF_DOS_PATH) {
char *converted_fname;
SET_STAT_INVALID(sbuf);
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*/
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*/
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*/
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*/
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*/
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*/
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),
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),
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*/
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*/
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*/
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),
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),
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*/
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),
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),