diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/clifile.c | 32 | ||||
-rw-r--r-- | source4/libcli/clireadwrite.c | 6 | ||||
-rw-r--r-- | source4/libcli/clitrans2.c | 10 | ||||
-rw-r--r-- | source4/libcli/raw/interfaces.h | 291 | ||||
-rw-r--r-- | source4/libcli/raw/rawacl.c | 4 | ||||
-rw-r--r-- | source4/libcli/raw/rawfile.c | 34 | ||||
-rw-r--r-- | source4/libcli/raw/rawfileinfo.c | 8 | ||||
-rw-r--r-- | source4/libcli/raw/rawioctl.c | 4 | ||||
-rw-r--r-- | source4/libcli/raw/rawnotify.c | 2 | ||||
-rw-r--r-- | source4/libcli/raw/rawreadwrite.c | 18 | ||||
-rw-r--r-- | source4/libcli/raw/rawsetfileinfo.c | 8 | ||||
-rw-r--r-- | source4/libcli/smb2/getinfo.c | 2 | ||||
-rw-r--r-- | source4/libcli/smb2/setinfo.c | 2 | ||||
-rw-r--r-- | source4/libcli/smb_composite/appendacl.c | 8 | ||||
-rw-r--r-- | source4/libcli/smb_composite/loadfile.c | 8 | ||||
-rw-r--r-- | source4/libcli/smb_composite/savefile.c | 8 |
16 files changed, 237 insertions, 208 deletions
diff --git a/source4/libcli/clifile.c b/source4/libcli/clifile.c index d3de0dab77..cc0c14a2e8 100644 --- a/source4/libcli/clifile.c +++ b/source4/libcli/clifile.c @@ -38,11 +38,11 @@ static NTSTATUS smbcli_link_internal(struct smbcli_tree *tree, if (hard_link) { parms.generic.level = RAW_SFILEINFO_UNIX_HLINK; - parms.unix_hlink.file.path = fname_src; + parms.unix_hlink.in.file.path = fname_src; parms.unix_hlink.in.link_dest = fname_dst; } else { parms.generic.level = RAW_SFILEINFO_UNIX_LINK; - parms.unix_link.file.path = fname_src; + parms.unix_link.in.file.path = fname_src; parms.unix_link.in.link_dest = fname_dst; } @@ -110,7 +110,7 @@ static NTSTATUS smbcli_unix_chmod_chown_internal(struct smbcli_tree *tree, NTSTATUS status; parms.generic.level = SMB_SFILEINFO_UNIX_BASIC; - parms.unix_basic.file.path = fname; + parms.unix_basic.in.file.path = fname; parms.unix_basic.in.uid = uid; parms.unix_basic.in.gid = gid; parms.unix_basic.in.mode = mode; @@ -213,7 +213,7 @@ NTSTATUS smbcli_nt_delete_on_close(struct smbcli_tree *tree, int fnum, BOOL flag NTSTATUS status; parms.disposition_info.level = RAW_SFILEINFO_DISPOSITION_INFO; - parms.disposition_info.file.fnum = fnum; + parms.disposition_info.in.file.fnum = fnum; parms.disposition_info.in.delete_on_close = flag; status = smb_raw_setfileinfo(tree, &parms); @@ -256,7 +256,7 @@ int smbcli_nt_create_full(struct smbcli_tree *tree, const char *fname, talloc_free(mem_ctx); if (NT_STATUS_IS_OK(status)) { - return open_parms.ntcreatex.file.fnum; + return open_parms.ntcreatex.out.file.fnum; } return -1; @@ -323,7 +323,7 @@ int smbcli_open(struct smbcli_tree *tree, const char *fname, int flags, talloc_free(mem_ctx); if (NT_STATUS_IS_OK(status)) { - return open_parms.openx.file.fnum; + return open_parms.openx.out.file.fnum; } return -1; @@ -339,7 +339,7 @@ NTSTATUS smbcli_close(struct smbcli_tree *tree, int fnum) NTSTATUS status; close_parms.close.level = RAW_CLOSE_CLOSE; - close_parms.close.file.fnum = fnum; + close_parms.close.in.file.fnum = fnum; close_parms.close.in.write_time = 0; status = smb_raw_close(tree, &close_parms); return status; @@ -358,7 +358,7 @@ NTSTATUS smbcli_locktype(struct smbcli_tree *tree, int fnum, NTSTATUS status; parms.lockx.level = RAW_LOCK_LOCKX; - parms.lockx.file.fnum = fnum; + parms.lockx.in.file.fnum = fnum; parms.lockx.in.mode = locktype; parms.lockx.in.timeout = timeout; parms.lockx.in.ulock_cnt = 0; @@ -386,7 +386,7 @@ NTSTATUS smbcli_lock(struct smbcli_tree *tree, int fnum, NTSTATUS status; parms.lockx.level = RAW_LOCK_LOCKX; - parms.lockx.file.fnum = fnum; + parms.lockx.in.file.fnum = fnum; parms.lockx.in.mode = (lock_type == READ_LOCK? 1 : 0); parms.lockx.in.timeout = timeout; parms.lockx.in.ulock_cnt = 0; @@ -412,7 +412,7 @@ NTSTATUS smbcli_unlock(struct smbcli_tree *tree, int fnum, uint32_t offset, uint NTSTATUS status; parms.lockx.level = RAW_LOCK_LOCKX; - parms.lockx.file.fnum = fnum; + parms.lockx.in.file.fnum = fnum; parms.lockx.in.mode = 0; parms.lockx.in.timeout = 0; parms.lockx.in.ulock_cnt = 1; @@ -444,7 +444,7 @@ NTSTATUS smbcli_lock64(struct smbcli_tree *tree, int fnum, } parms.lockx.level = RAW_LOCK_LOCKX; - parms.lockx.file.fnum = fnum; + parms.lockx.in.file.fnum = fnum; ltype = (lock_type == READ_LOCK? 1 : 0); ltype |= LOCKING_ANDX_LARGE_FILES; @@ -478,7 +478,7 @@ NTSTATUS smbcli_unlock64(struct smbcli_tree *tree, int fnum, off_t offset, } parms.lockx.level = RAW_LOCK_LOCKX; - parms.lockx.file.fnum = fnum; + parms.lockx.in.file.fnum = fnum; parms.lockx.in.mode = LOCKING_ANDX_LARGE_FILES; parms.lockx.in.timeout = 0; parms.lockx.in.ulock_cnt = 1; @@ -505,7 +505,7 @@ NTSTATUS smbcli_getattrE(struct smbcli_tree *tree, int fnum, NTSTATUS status; parms.getattre.level = RAW_FILEINFO_GETATTRE; - parms.getattre.file.fnum = fnum; + parms.getattre.in.file.fnum = fnum; status = smb_raw_fileinfo(tree, NULL, &parms); @@ -545,7 +545,7 @@ NTSTATUS smbcli_getatr(struct smbcli_tree *tree, const char *fname, NTSTATUS status; parms.getattr.level = RAW_FILEINFO_GETATTR; - parms.getattr.file.path = fname; + parms.getattr.in.file.path = fname; status = smb_raw_pathinfo(tree, NULL, &parms); @@ -579,7 +579,7 @@ NTSTATUS smbcli_setatr(struct smbcli_tree *tree, const char *fname, uint16_t mod NTSTATUS status; parms.setattr.level = RAW_SFILEINFO_SETATTR; - parms.setattr.file.path = fname; + parms.setattr.in.file.path = fname; parms.setattr.in.attrib = mode; parms.setattr.in.write_time = t; @@ -663,7 +663,7 @@ int smbcli_ctemp(struct smbcli_tree *tree, const char *path, char **tmp_path) } talloc_free(mem_ctx); if (NT_STATUS_IS_OK(status)) { - return open_parms.ctemp.file.fnum; + return open_parms.ctemp.out.file.fnum; } return -1; } diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 03d1864a5d..afffeadeff 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -38,7 +38,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, void *_buf, off_t offset } parms.readx.level = RAW_READ_READX; - parms.readx.file.fnum = fnum; + parms.readx.in.file.fnum = fnum; /* * Set readsize to the maximum size we can handle in one readX, @@ -101,7 +101,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, parms.writex.level = RAW_WRITE_WRITEX; - parms.writex.file.fnum = fnum; + parms.writex.in.file.fnum = fnum; parms.writex.in.wmode = write_mode; parms.writex.in.remaining = 0; @@ -145,7 +145,7 @@ ssize_t smbcli_smbwrite(struct smbcli_tree *tree, size_t size = MIN(size1, tree->session->transport->negotiate.max_xmit - 48); if (size > 0xFFFF) size = 0xFFFF; - parms.write.file.fnum = fnum; + parms.write.in.file.fnum = fnum; parms.write.in.offset = offset; parms.write.in.count = size; parms.write.in.data = buf + total; diff --git a/source4/libcli/clitrans2.c b/source4/libcli/clitrans2.c index f8699e0191..9418c10538 100644 --- a/source4/libcli/clitrans2.c +++ b/source4/libcli/clitrans2.c @@ -36,7 +36,7 @@ NTSTATUS smbcli_qpathinfo(struct smbcli_tree *tree, const char *fname, if (!mem_ctx) return NT_STATUS_NO_MEMORY; parms.standard.level = RAW_FILEINFO_STANDARD; - parms.standard.file.path = fname; + parms.standard.in.file.path = fname; status = smb_raw_pathinfo(tree, mem_ctx, &parms); talloc_free(mem_ctx); @@ -78,7 +78,7 @@ NTSTATUS smbcli_qpathinfo2(struct smbcli_tree *tree, const char *fname, if (!mem_ctx) return NT_STATUS_NO_MEMORY; parms.all_info.level = RAW_FILEINFO_ALL_INFO; - parms.all_info.file.path = fname; + parms.all_info.in.file.path = fname; status = smb_raw_pathinfo(tree, mem_ctx, &parms); talloc_free(mem_ctx); @@ -121,7 +121,7 @@ NTSTATUS smbcli_qfilename(struct smbcli_tree *tree, int fnum, const char **name) if (!mem_ctx) return NT_STATUS_NO_MEMORY; parms.name_info.level = RAW_FILEINFO_NAME_INFO; - parms.name_info.file.fnum = fnum; + parms.name_info.in.file.fnum = fnum; status = smb_raw_fileinfo(tree, mem_ctx, &parms); if (!NT_STATUS_IS_OK(status)) { @@ -155,7 +155,7 @@ NTSTATUS smbcli_qfileinfo(struct smbcli_tree *tree, int fnum, return NT_STATUS_NO_MEMORY; parms.all_info.level = RAW_FILEINFO_ALL_INFO; - parms.all_info.file.fnum = fnum; + parms.all_info.in.file.fnum = fnum; status = smb_raw_fileinfo(tree, mem_ctx, &parms); talloc_free(mem_ctx); @@ -200,7 +200,7 @@ NTSTATUS smbcli_qpathinfo_alt_name(struct smbcli_tree *tree, const char *fname, NTSTATUS status; parms.alt_name_info.level = RAW_FILEINFO_ALT_NAME_INFO; - parms.alt_name_info.file.path = fname; + parms.alt_name_info.in.file.path = fname; mem_ctx = talloc_init("smbcli_qpathinfo_alt_name"); if (!mem_ctx) return NT_STATUS_NO_MEMORY; diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h index 086686b9e9..20b729caba 100644 --- a/source4/libcli/raw/interfaces.h +++ b/source4/libcli/raw/interfaces.h @@ -40,17 +40,46 @@ struct smb_wire_string { }; /* - a generic container for file handles + * SMB2 uses a 16Byte handle, + * (we can maybe use struct GUID later) + */ +struct smb2_handle { + uint64_t data[2]; +}; + +/* + * a generic container for file handles or file pathes + * for qfileinfo/setfileinfo and qpathinfo/setpathinfo */ -union smb_file { +union smb_handle_or_path { /* - * this is only used for + * this is used for * the qpathinfo and setpathinfo * calls */ const char *path; + /* + * this is used as file handle in SMB + */ + uint16_t fnum; /* + * this is used as file handle in SMB2 + */ + struct smb2_handle handle; +}; + +/* + a generic container for file handles +*/ +union smb_handle { + /* + * this is used for + * the qpathinfo and setpathinfo + * calls + */ + const char *path; + /* * this is used as file handle in SMB */ uint16_t fnum; @@ -58,9 +87,7 @@ union smb_file { /* * this is used as file handle in SMB2 */ - struct smb2_handle { - uint64_t data[2]; - } handle; + struct smb2_handle handle; }; /* @@ -71,8 +98,8 @@ union smb_file { /* struct used for SMBlseek call */ union smb_seek { struct { - union smb_file file; struct { + union smb_handle file; uint16_t mode; int32_t offset; /* signed */ } in; @@ -343,8 +370,9 @@ union smb_fileinfo { * matches RAW_FILEINFO_GENERIC */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint32_t attrib; uint32_t ea_size; @@ -390,8 +418,9 @@ union smb_fileinfo { * matches RAW_FILEINFO_GETATTR */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint16_t attrib; uint32_t size; @@ -402,8 +431,9 @@ union smb_fileinfo { /* SMBgetattrE and RAW_FILEINFO_STANDARD interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { time_t create_time; time_t access_time; @@ -417,8 +447,9 @@ union smb_fileinfo { /* trans2 RAW_FILEINFO_EA_SIZE interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { time_t create_time; time_t access_time; @@ -433,9 +464,8 @@ union smb_fileinfo { /* trans2 RAW_FILEINFO_EA_LIST interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - struct { + union smb_handle_or_path file; uint_t num_names; struct ea_name { struct smb_wire_string name; @@ -451,8 +481,8 @@ union smb_fileinfo { /* trans2 RAW_FILEINFO_ALL_EAS and RAW_FILEINFO_FULL_EA_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; /* SMB2 only - SMB2_CONTINUE_FLAG_* */ uint8_t continue_flags; } in; @@ -463,14 +493,17 @@ union smb_fileinfo { only valid for a QPATHNAME call - no returned data */ struct { enum smb_fileinfo_level level; - union smb_file file; + struct { + union smb_handle_or_path file; + } in; } is_name_valid; /* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { NTTIME create_time; NTTIME access_time; @@ -484,8 +517,9 @@ union smb_fileinfo { /* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint64_t alloc_size; uint64_t size; @@ -498,8 +532,9 @@ union smb_fileinfo { /* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint32_t ea_size; } out; @@ -508,8 +543,9 @@ union smb_fileinfo { /* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { struct smb_wire_string fname; } out; @@ -518,8 +554,9 @@ union smb_fileinfo { /* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { NTTIME create_time; NTTIME access_time; @@ -539,8 +576,9 @@ union smb_fileinfo { /* RAW_FILEINFO_SMB2_ALL_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { NTTIME create_time; NTTIME access_time; @@ -561,13 +599,14 @@ union smb_fileinfo { uint64_t mode; struct smb_wire_string fname; } out; - } all_info2; + } all_info2; /* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { struct smb_wire_string fname; } out; @@ -576,8 +615,9 @@ union smb_fileinfo { /* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct stream_information { uint_t num_streams; struct stream_struct *streams; @@ -587,8 +627,9 @@ union smb_fileinfo { /* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint64_t compressed_size; uint16_t format; @@ -601,8 +642,9 @@ union smb_fileinfo { /* RAW_FILEINFO_UNIX_BASIC interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint64_t end_of_file; uint64_t num_bytes; @@ -623,8 +665,9 @@ union smb_fileinfo { /* RAW_FILEINFO_UNIX_LINK interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { struct smb_wire_string link_dest; } out; @@ -633,8 +676,9 @@ union smb_fileinfo { /* RAW_FILEINFO_INTERNAL_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint64_t file_id; } out; @@ -643,8 +687,9 @@ union smb_fileinfo { /* RAW_FILEINFO_ACCESS_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint32_t access_flags; } out; @@ -653,8 +698,9 @@ union smb_fileinfo { /* RAW_FILEINFO_POSITION_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint64_t position; } out; @@ -663,8 +709,9 @@ union smb_fileinfo { /* RAW_FILEINFO_MODE_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint32_t mode; } out; @@ -673,8 +720,9 @@ union smb_fileinfo { /* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint32_t alignment_requirement; } out; @@ -683,8 +731,9 @@ union smb_fileinfo { /* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { NTTIME create_time; NTTIME access_time; @@ -700,8 +749,9 @@ union smb_fileinfo { /* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */ struct { enum smb_fileinfo_level level; - union smb_file file; - + struct { + union smb_handle_or_path file; + } in; struct { uint32_t attrib; uint32_t reparse_tag; @@ -711,8 +761,8 @@ union smb_fileinfo { /* RAW_FILEINFO_SEC_DESC */ struct { enum smb_fileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint32_t secinfo_flags; } in; struct { @@ -756,15 +806,16 @@ union smb_setfileinfo { /* generic interface */ struct { enum smb_setfileinfo_level level; - - union smb_file file; + struct { + union smb_handle_or_path file; + } in; } generic; /* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint16_t attrib; time_t write_time; } in; @@ -774,8 +825,8 @@ union smb_setfileinfo { also RAW_SFILEINFO_STANDARD */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; time_t create_time; time_t access_time; time_t write_time; @@ -787,8 +838,8 @@ union smb_setfileinfo { /* RAW_SFILEINFO_EA_SET interface */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint_t num_eas; struct ea_struct *eas; } in; @@ -798,8 +849,8 @@ union smb_setfileinfo { RAW_SFILEINFO_BASIC_INFORMATION interfaces */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; NTTIME create_time; NTTIME access_time; NTTIME write_time; @@ -812,8 +863,8 @@ union smb_setfileinfo { RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; BOOL delete_on_close; } in; } disposition_info; @@ -822,8 +873,8 @@ union smb_setfileinfo { RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; /* w2k3 rounds this up to nearest 4096 */ uint64_t alloc_size; } in; @@ -833,8 +884,8 @@ union smb_setfileinfo { RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint64_t size; } in; } end_of_file_info; @@ -842,8 +893,8 @@ union smb_setfileinfo { /* RAW_SFILEINFO_RENAME_INFORMATION interface */ struct { enum smb_setfileinfo_level level; - union smb_file file; - struct smb_rename_information { + struct { + union smb_handle_or_path file; uint8_t overwrite; uint32_t root_fid; const char *new_name; @@ -853,8 +904,8 @@ union smb_setfileinfo { /* RAW_SFILEINFO_POSITION_INFORMATION interface */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint64_t position; } in; } position_information; @@ -862,8 +913,8 @@ union smb_setfileinfo { /* RAW_SFILEINFO_MODE_INFORMATION interface */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; /* valid values seem to be 0, 2, 4 and 6 */ uint32_t mode; } in; @@ -874,8 +925,8 @@ union smb_setfileinfo { /* RAW_SFILEINFO_UNIX_BASIC interface */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */ uint64_t end_of_file; uint64_t num_bytes; @@ -896,8 +947,8 @@ union smb_setfileinfo { /* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; const char *link_dest; } in; } unix_link, unix_hlink; @@ -905,8 +956,8 @@ union smb_setfileinfo { /* RAW_FILEINFO_SET_SEC_DESC */ struct { enum smb_setfileinfo_level level; - union smb_file file; struct { + union smb_handle_or_path file; uint32_t secinfo_flags; struct security_descriptor *sd; } in; @@ -1114,9 +1165,6 @@ union smb_open { /* SMBNTCreateX interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint32_t flags; uint32_t root_fid; @@ -1138,8 +1186,8 @@ union smb_open { struct security_descriptor *sec_desc; struct smb_ea_list *ea_list; } in; - struct { + union smb_handle file; uint8_t oplock_level; uint32_t create_action; NTTIME create_time; @@ -1158,9 +1206,6 @@ union smb_open { /* TRANS2_OPEN interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t flags; uint16_t open_mode; @@ -1174,8 +1219,8 @@ union smb_open { uint_t num_eas; struct ea_struct *eas; } in; - struct { + union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; @@ -1190,16 +1235,13 @@ union smb_open { /* SMBopen interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t open_mode; uint16_t search_attrs; const char *fname; } in; - struct { + union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; @@ -1210,9 +1252,6 @@ union smb_open { /* SMBopenX interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t flags; uint16_t open_mode; @@ -1227,6 +1266,7 @@ union smb_open { const char *fname; } in; struct { + union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; @@ -1243,28 +1283,26 @@ union smb_open { /* SMBmknew interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t attrib; time_t write_time; const char *fname; } in; + struct { + union smb_handle file; + } out; } mknew, create; /* SMBctemp interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t attrib; time_t write_time; const char *directory; } in; struct { + union smb_handle file; /* temp name, relative to directory */ char *name; } out; @@ -1273,23 +1311,20 @@ union smb_open { /* SMBsplopen interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t setup_length; uint16_t mode; const char *ident; } in; + struct { + union smb_handle file; + } out; } splopen; /* chained OpenX/ReadX interface */ struct { enum smb_open_level level; - /* this is the output file handle */ - union smb_file file; - struct { uint16_t flags; uint16_t open_mode; @@ -1310,6 +1345,7 @@ union smb_open { uint16_t remaining; } in; struct { + union smb_handle file; uint16_t attrib; time_t write_time; uint32_t size; @@ -1345,9 +1381,8 @@ union smb_read { /* SMBreadX (and generic) interface */ struct { enum smb_read_level level; - union smb_file file; - struct { + union smb_handle file; uint64_t offset; uint16_t mincnt; uint32_t maxcnt; @@ -1365,9 +1400,8 @@ union smb_read { /* SMBreadbraw interface */ struct { enum smb_read_level level; - union smb_file file; - struct { + union smb_handle file; uint64_t offset; uint16_t maxcnt; uint16_t mincnt; @@ -1383,9 +1417,8 @@ union smb_read { /* SMBlockandread interface */ struct { enum smb_read_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; @@ -1399,9 +1432,8 @@ union smb_read { /* SMBread interface */ struct { enum smb_read_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; @@ -1426,9 +1458,8 @@ union smb_write { /* SMBwriteX interface */ struct { enum smb_write_level level; - union smb_file file; - struct { + union smb_handle file; uint64_t offset; uint16_t wmode; uint16_t remaining; @@ -1444,9 +1475,8 @@ union smb_write { /* SMBwriteunlock interface */ struct { enum smb_write_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; @@ -1460,9 +1490,8 @@ union smb_write { /* SMBwrite interface */ struct { enum smb_write_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t count; uint32_t offset; uint16_t remaining; @@ -1476,9 +1505,8 @@ union smb_write { /* SMBwriteclose interface */ struct { enum smb_write_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t count; uint32_t offset; time_t mtime; @@ -1492,9 +1520,8 @@ union smb_write { /* SMBsplwrite interface */ struct { enum smb_write_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t count; const uint8_t *data; } in; @@ -1513,9 +1540,8 @@ union smb_lock { /* SMBlockingX (and generic) interface */ struct { enum smb_lock_level level; - union smb_file file; - struct { + union smb_handle file; uint16_t mode; uint32_t timeout; uint16_t ulock_cnt; @@ -1531,9 +1557,8 @@ union smb_lock { /* SMBlock and SMBunlock interface */ struct { enum smb_lock_level level; - union smb_file file; - struct { + union smb_handle file; uint32_t count; uint32_t offset; } in; @@ -1552,9 +1577,8 @@ union smb_close { /* SMBclose (and generic) interface */ struct { enum smb_close_level level; - union smb_file file; - struct { + union smb_handle file; time_t write_time; } in; } close, generic; @@ -1562,7 +1586,9 @@ union smb_close { /* SMBsplclose interface - empty! */ struct { enum smb_close_level level; - union smb_file file; + struct { + union smb_handle file; + } in; } splclose; }; @@ -1611,15 +1637,16 @@ union smb_ioctl { /* generic interface */ struct { enum smb_ioctl_level level; - union smb_file file; - + struct { + union smb_handle file; + } in; } generic; /* struct for SMBioctl */ struct { enum smb_ioctl_level level; - union smb_file file; struct { + union smb_handle file; uint32_t request; } in; struct { @@ -1631,8 +1658,8 @@ union smb_ioctl { /* struct for NT ioctl call */ struct { enum smb_ioctl_level level; - union smb_file file; struct { + union smb_handle file; uint32_t function; BOOL fsctl; uint8_t filter; @@ -1646,7 +1673,9 @@ union smb_ioctl { /* struct for SMBflush */ union smb_flush { struct { - union smb_file file; + struct { + union smb_handle file; + } in; } flush; }; @@ -1714,8 +1743,8 @@ struct smb_nttrans { /* struct for nttrans change notify call */ union smb_notify { struct { - union smb_file file; struct { + union smb_handle file; uint32_t buffer_size; uint32_t completion_filter; BOOL recursive; diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c index 7c0c17b4d7..59ac65a340 100644 --- a/source4/libcli/raw/rawacl.c +++ b/source4/libcli/raw/rawacl.c @@ -38,7 +38,7 @@ struct smbcli_request *smb_raw_query_secdesc_send(struct smbcli_tree *tree, nt.in.function = NT_TRANSACT_QUERY_SECURITY_DESC; nt.in.setup = NULL; - SSVAL(params, 0, io->query_secdesc.file.fnum); + SSVAL(params, 0, io->query_secdesc.in.file.fnum); SSVAL(params, 2, 0); /* padding */ SIVAL(params, 4, io->query_secdesc.in.secinfo_flags); @@ -123,7 +123,7 @@ struct smbcli_request *smb_raw_set_secdesc_send(struct smbcli_tree *tree, nt.in.function = NT_TRANSACT_SET_SECURITY_DESC; nt.in.setup = NULL; - SSVAL(params, 0, io->set_secdesc.file.fnum); + SSVAL(params, 0, io->set_secdesc.in.file.fnum); SSVAL(params, 2, 0); /* padding */ SIVAL(params, 4, io->set_secdesc.in.secinfo_flags); diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c index 0e63fa656f..6f8befebfe 100644 --- a/source4/libcli/raw/rawfile.c +++ b/source4/libcli/raw/rawfile.c @@ -234,7 +234,7 @@ static NTSTATUS smb_raw_nttrans_create_recv(struct smbcli_request *req, params = nt.out.params.data; parms->ntcreatex.out.oplock_level = CVAL(params, 0); - parms->ntcreatex.file.fnum = SVAL(params, 2); + parms->ntcreatex.out.file.fnum = SVAL(params, 2); parms->ntcreatex.out.create_action = IVAL(params, 4); parms->ntcreatex.out.create_time = smbcli_pull_nttime(params, 12); parms->ntcreatex.out.access_time = smbcli_pull_nttime(params, 20); @@ -406,7 +406,7 @@ static NTSTATUS smb_raw_t2open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ return NT_STATUS_INFO_LENGTH_MISMATCH; } - parms->t2open.file.fnum = SVAL(t2.out.params.data, VWV(0)); + parms->t2open.out.file.fnum = SVAL(t2.out.params.data, VWV(0)); parms->t2open.out.attrib = SVAL(t2.out.params.data, VWV(1)); parms->t2open.out.write_time = raw_pull_dos_date3(transport, t2.out.params.data + VWV(2)); parms->t2open.out.size = IVAL(t2.out.params.data, VWV(4)); @@ -572,7 +572,7 @@ NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, unio case RAW_OPEN_OPEN: SMBCLI_CHECK_WCT(req, 7); - parms->openold.file.fnum = SVAL(req->in.vwv, VWV(0)); + parms->openold.out.file.fnum = SVAL(req->in.vwv, VWV(0)); parms->openold.out.attrib = SVAL(req->in.vwv, VWV(1)); parms->openold.out.write_time = raw_pull_dos_date3(req->transport, req->in.vwv + VWV(2)); @@ -582,7 +582,7 @@ NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, unio case RAW_OPEN_OPENX: SMBCLI_CHECK_MIN_WCT(req, 15); - parms->openx.file.fnum = SVAL(req->in.vwv, VWV(2)); + parms->openx.out.file.fnum = SVAL(req->in.vwv, VWV(2)); parms->openx.out.attrib = SVAL(req->in.vwv, VWV(3)); parms->openx.out.write_time = raw_pull_dos_date3(req->transport, req->in.vwv + VWV(4)); @@ -603,29 +603,29 @@ NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, unio case RAW_OPEN_MKNEW: SMBCLI_CHECK_WCT(req, 1); - parms->mknew.file.fnum = SVAL(req->in.vwv, VWV(0)); + parms->mknew.out.file.fnum = SVAL(req->in.vwv, VWV(0)); break; case RAW_OPEN_CREATE: SMBCLI_CHECK_WCT(req, 1); - parms->create.file.fnum = SVAL(req->in.vwv, VWV(0)); + parms->create.out.file.fnum = SVAL(req->in.vwv, VWV(0)); break; case RAW_OPEN_CTEMP: SMBCLI_CHECK_WCT(req, 1); - parms->ctemp.file.fnum = SVAL(req->in.vwv, VWV(0)); + parms->ctemp.out.file.fnum = SVAL(req->in.vwv, VWV(0)); smbcli_req_pull_string(req, mem_ctx, &parms->ctemp.out.name, req->in.data, -1, STR_TERMINATE | STR_ASCII); break; case RAW_OPEN_SPLOPEN: SMBCLI_CHECK_WCT(req, 1); - parms->splopen.file.fnum = SVAL(req->in.vwv, VWV(0)); + parms->splopen.out.file.fnum = SVAL(req->in.vwv, VWV(0)); break; case RAW_OPEN_NTCREATEX: SMBCLI_CHECK_MIN_WCT(req, 34); parms->ntcreatex.out.oplock_level = CVAL(req->in.vwv, 4); - parms->ntcreatex.file.fnum = SVAL(req->in.vwv, 5); + parms->ntcreatex.out.file.fnum = SVAL(req->in.vwv, 5); parms->ntcreatex.out.create_action = IVAL(req->in.vwv, 7); parms->ntcreatex.out.create_time = smbcli_pull_nttime(req->in.vwv, 11); parms->ntcreatex.out.access_time = smbcli_pull_nttime(req->in.vwv, 19); @@ -644,7 +644,7 @@ NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, unio case RAW_OPEN_OPENX_READX: SMBCLI_CHECK_MIN_WCT(req, 15); - parms->openxreadx.file.fnum = SVAL(req->in.vwv, VWV(2)); + parms->openxreadx.out.file.fnum = SVAL(req->in.vwv, VWV(2)); parms->openxreadx.out.attrib = SVAL(req->in.vwv, VWV(3)); parms->openxreadx.out.write_time = raw_pull_dos_date3(req->transport, req->in.vwv + VWV(4)); @@ -706,14 +706,14 @@ struct smbcli_request *smb_raw_close_send(struct smbcli_tree *tree, union smb_cl switch (parms->generic.level) { case RAW_CLOSE_CLOSE: SETUP_REQUEST(SMBclose, 3, 0); - SSVAL(req->out.vwv, VWV(0), parms->close.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->close.in.file.fnum); raw_push_dos_date3(tree->session->transport, req->out.vwv, VWV(1), parms->close.in.write_time); break; case RAW_CLOSE_SPLCLOSE: SETUP_REQUEST(SMBsplclose, 3, 0); - SSVAL(req->out.vwv, VWV(0), parms->splclose.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->splclose.in.file.fnum); SIVAL(req->out.vwv, VWV(1), 0); /* reserved */ break; } @@ -749,14 +749,14 @@ struct smbcli_request *smb_raw_lock_send(struct smbcli_tree *tree, union smb_loc switch (parms->generic.level) { case RAW_LOCK_LOCK: SETUP_REQUEST(SMBlock, 5, 0); - SSVAL(req->out.vwv, VWV(0), parms->lock.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->lock.in.file.fnum); SIVAL(req->out.vwv, VWV(1), parms->lock.in.count); SIVAL(req->out.vwv, VWV(3), parms->lock.in.offset); break; case RAW_LOCK_UNLOCK: SETUP_REQUEST(SMBunlock, 5, 0); - SSVAL(req->out.vwv, VWV(0), parms->unlock.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->unlock.in.file.fnum); SIVAL(req->out.vwv, VWV(1), parms->unlock.in.count); SIVAL(req->out.vwv, VWV(3), parms->unlock.in.offset); break; @@ -770,7 +770,7 @@ struct smbcli_request *smb_raw_lock_send(struct smbcli_tree *tree, union smb_loc SETUP_REQUEST(SMBlockingX, 8, lck_size * lock_count); SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE); SSVAL(req->out.vwv, VWV(1), 0); - SSVAL(req->out.vwv, VWV(2), parms->lockx.file.fnum); + SSVAL(req->out.vwv, VWV(2), parms->lockx.in.file.fnum); SSVAL(req->out.vwv, VWV(3), parms->lockx.in.mode); SIVAL(req->out.vwv, VWV(4), parms->lockx.in.timeout); SSVAL(req->out.vwv, VWV(6), parms->lockx.in.ulock_cnt); @@ -850,7 +850,7 @@ struct smbcli_request *smb_raw_flush_send(struct smbcli_tree *tree, union smb_fl struct smbcli_request *req; SETUP_REQUEST(SMBflush, 1, 0); - SSVAL(req->out.vwv, VWV(0), parms->flush.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->flush.in.file.fnum); if (!smbcli_request_send(req)) { smbcli_request_destroy(req); @@ -881,7 +881,7 @@ struct smbcli_request *smb_raw_seek_send(struct smbcli_tree *tree, SETUP_REQUEST(SMBlseek, 4, 0); - SSVAL(req->out.vwv, VWV(0), parms->lseek.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->lseek.in.file.fnum); SSVAL(req->out.vwv, VWV(1), parms->lseek.in.mode); SIVALS(req->out.vwv, VWV(2), parms->lseek.in.offset); diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c index b50a330093..cf8f2f71b4 100644 --- a/source4/libcli/raw/rawfileinfo.c +++ b/source4/libcli/raw/rawfileinfo.c @@ -536,7 +536,7 @@ static struct smbcli_request *smb_raw_getattr_send(struct smbcli_tree *tree, req = smbcli_request_setup(tree, SMBgetatr, 0, 0); if (!req) return NULL; - smbcli_req_append_ascii4(req, parms->getattr.file.path, STR_TERMINATE); + smbcli_req_append_ascii4(req, parms->getattr.in.file.path, STR_TERMINATE); if (!smbcli_request_send(req)) { smbcli_request_destroy(req); @@ -579,7 +579,7 @@ static struct smbcli_request *smb_raw_getattrE_send(struct smbcli_tree *tree, req = smbcli_request_setup(tree, SMBgetattrE, 1, 0); if (!req) return NULL; - SSVAL(req->out.vwv, VWV(0), parms->getattre.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->getattre.in.file.fnum); if (!smbcli_request_send(req)) { smbcli_request_destroy(req); return NULL; @@ -647,7 +647,7 @@ struct smbcli_request *smb_raw_fileinfo_send(struct smbcli_tree *tree, } req = smb_raw_fileinfo_blob_send(tree, - parms->generic.file.fnum, + parms->generic.in.file.fnum, parms->generic.level, data); data_blob_free(&data); @@ -722,7 +722,7 @@ struct smbcli_request *smb_raw_pathinfo_send(struct smbcli_tree *tree, } } - req = smb_raw_pathinfo_blob_send(tree, parms->generic.file.path, + req = smb_raw_pathinfo_blob_send(tree, parms->generic.in.file.path, parms->generic.level, data); data_blob_free(&data); diff --git a/source4/libcli/raw/rawioctl.c b/source4/libcli/raw/rawioctl.c index 28b58ff2a3..db980a55d6 100644 --- a/source4/libcli/raw/rawioctl.c +++ b/source4/libcli/raw/rawioctl.c @@ -37,7 +37,7 @@ static struct smbcli_request *smb_raw_smbioctl_send(struct smbcli_tree *tree, SETUP_REQUEST(SMBioctl, 3, 0); - SSVAL(req->out.vwv, VWV(0), parms->ioctl.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->ioctl.in.file.fnum); SIVAL(req->out.vwv, VWV(1), parms->ioctl.in.request); if (!smbcli_request_send(req)) { @@ -81,7 +81,7 @@ static struct smbcli_request *smb_raw_ntioctl_send(struct smbcli_tree *tree, nt.in.setup_count = 4; nt.in.setup = setup; SIVAL(setup, 0, parms->ntioctl.in.function); - SSVAL(setup, 4, parms->ntioctl.file.fnum); + SSVAL(setup, 4, parms->ntioctl.in.file.fnum); SCVAL(setup, 6, parms->ntioctl.in.fsctl); SCVAL(setup, 7, parms->ntioctl.in.filter); nt.in.function = NT_TRANSACT_IOCTL; diff --git a/source4/libcli/raw/rawnotify.c b/source4/libcli/raw/rawnotify.c index 3adb1b000b..c06f0a59f7 100644 --- a/source4/libcli/raw/rawnotify.c +++ b/source4/libcli/raw/rawnotify.c @@ -36,7 +36,7 @@ struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union nt.in.setup_count = 4; nt.in.setup = setup; SIVAL(setup, 0, parms->notify.in.completion_filter); - SSVAL(setup, 4, parms->notify.file.fnum); + SSVAL(setup, 4, parms->notify.in.file.fnum); SSVAL(setup, 6, parms->notify.in.recursive); nt.in.function = NT_TRANSACT_NOTIFY_CHANGE; nt.in.params = data_blob(NULL, 0); diff --git a/source4/libcli/raw/rawreadwrite.c b/source4/libcli/raw/rawreadwrite.c index c4e2ab2498..7f1aaf26d4 100644 --- a/source4/libcli/raw/rawreadwrite.c +++ b/source4/libcli/raw/rawreadwrite.c @@ -41,7 +41,7 @@ struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_rea bigoffset = True; } SETUP_REQUEST(SMBreadbraw, bigoffset? 10:8, 0); - SSVAL(req->out.vwv, VWV(0), parms->readbraw.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->readbraw.in.file.fnum); SIVAL(req->out.vwv, VWV(1), parms->readbraw.in.offset); SSVAL(req->out.vwv, VWV(3), parms->readbraw.in.maxcnt); SSVAL(req->out.vwv, VWV(4), parms->readbraw.in.mincnt); @@ -54,7 +54,7 @@ struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_rea case RAW_READ_LOCKREAD: SETUP_REQUEST(SMBlockread, 5, 0); - SSVAL(req->out.vwv, VWV(0), parms->lockread.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->lockread.in.file.fnum); SSVAL(req->out.vwv, VWV(1), parms->lockread.in.count); SIVAL(req->out.vwv, VWV(2), parms->lockread.in.offset); SSVAL(req->out.vwv, VWV(4), parms->lockread.in.remaining); @@ -62,7 +62,7 @@ struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_rea case RAW_READ_READ: SETUP_REQUEST(SMBread, 5, 0); - SSVAL(req->out.vwv, VWV(0), parms->read.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->read.in.file.fnum); SSVAL(req->out.vwv, VWV(1), parms->read.in.count); SIVAL(req->out.vwv, VWV(2), parms->read.in.offset); SSVAL(req->out.vwv, VWV(4), parms->read.in.remaining); @@ -75,7 +75,7 @@ struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_rea SETUP_REQUEST(SMBreadX, bigoffset ? 12 : 10, 0); SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE); SSVAL(req->out.vwv, VWV(1), 0); - SSVAL(req->out.vwv, VWV(2), parms->readx.file.fnum); + SSVAL(req->out.vwv, VWV(2), parms->readx.in.file.fnum); SIVAL(req->out.vwv, VWV(3), parms->readx.in.offset); SSVAL(req->out.vwv, VWV(5), parms->readx.in.maxcnt & 0xFFFF); SSVAL(req->out.vwv, VWV(6), parms->readx.in.mincnt); @@ -186,7 +186,7 @@ struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_wr switch (parms->generic.level) { case RAW_WRITE_WRITEUNLOCK: SETUP_REQUEST(SMBwriteunlock, 5, 3 + parms->writeunlock.in.count); - SSVAL(req->out.vwv, VWV(0), parms->writeunlock.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->writeunlock.in.file.fnum); SSVAL(req->out.vwv, VWV(1), parms->writeunlock.in.count); SIVAL(req->out.vwv, VWV(2), parms->writeunlock.in.offset); SSVAL(req->out.vwv, VWV(4), parms->writeunlock.in.remaining); @@ -200,7 +200,7 @@ struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_wr case RAW_WRITE_WRITE: SETUP_REQUEST(SMBwrite, 5, 3 + parms->write.in.count); - SSVAL(req->out.vwv, VWV(0), parms->write.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->write.in.file.fnum); SSVAL(req->out.vwv, VWV(1), parms->write.in.count); SIVAL(req->out.vwv, VWV(2), parms->write.in.offset); SSVAL(req->out.vwv, VWV(4), parms->write.in.remaining); @@ -213,7 +213,7 @@ struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_wr case RAW_WRITE_WRITECLOSE: SETUP_REQUEST(SMBwriteclose, 6, 1 + parms->writeclose.in.count); - SSVAL(req->out.vwv, VWV(0), parms->writeclose.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->writeclose.in.file.fnum); SSVAL(req->out.vwv, VWV(1), parms->writeclose.in.count); SIVAL(req->out.vwv, VWV(2), parms->writeclose.in.offset); raw_push_dos_date3(tree->session->transport, @@ -232,7 +232,7 @@ struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_wr SETUP_REQUEST(SMBwriteX, bigoffset ? 14 : 12, parms->writex.in.count); SSVAL(req->out.vwv, VWV(0), SMB_CHAIN_NONE); SSVAL(req->out.vwv, VWV(1), 0); - SSVAL(req->out.vwv, VWV(2), parms->writex.file.fnum); + SSVAL(req->out.vwv, VWV(2), parms->writex.in.file.fnum); SIVAL(req->out.vwv, VWV(3), parms->writex.in.offset); SIVAL(req->out.vwv, VWV(5), 0); /* reserved */ SSVAL(req->out.vwv, VWV(7), parms->writex.in.wmode); @@ -250,7 +250,7 @@ struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_wr case RAW_WRITE_SPLWRITE: SETUP_REQUEST(SMBsplwr, 1, parms->splwrite.in.count); - SSVAL(req->out.vwv, VWV(0), parms->splwrite.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->splwrite.in.file.fnum); if (parms->splwrite.in.count > 0) { memcpy(req->out.data, parms->splwrite.in.data, parms->splwrite.in.count); } diff --git a/source4/libcli/raw/rawsetfileinfo.c b/source4/libcli/raw/rawsetfileinfo.c index 73fcd82802..46480c636e 100644 --- a/source4/libcli/raw/rawsetfileinfo.c +++ b/source4/libcli/raw/rawsetfileinfo.c @@ -283,7 +283,7 @@ static struct smbcli_request *smb_raw_setattr_send(struct smbcli_tree *tree, raw_push_dos_date3(tree->session->transport, req->out.vwv, VWV(1), parms->setattr.in.write_time); memset(req->out.vwv + VWV(3), 0, 10); /* reserved */ - smbcli_req_append_ascii4(req, parms->setattr.file.path, STR_TERMINATE); + smbcli_req_append_ascii4(req, parms->setattr.in.file.path, STR_TERMINATE); smbcli_req_append_ascii4(req, "", STR_TERMINATE); if (!smbcli_request_send(req)) { @@ -305,7 +305,7 @@ static struct smbcli_request *smb_raw_setattrE_send(struct smbcli_tree *tree, req = smbcli_request_setup(tree, SMBsetattrE, 7, 0); if (!req) return NULL; - SSVAL(req->out.vwv, VWV(0), parms->setattre.file.fnum); + SSVAL(req->out.vwv, VWV(0), parms->setattre.in.file.fnum); raw_push_dos_date2(tree->session->transport, req->out.vwv, VWV(1), parms->setattre.in.create_time); raw_push_dos_date2(tree->session->transport, @@ -352,7 +352,7 @@ struct smbcli_request *smb_raw_setfileinfo_send(struct smbcli_tree *tree, /* send request and process the output */ req = smb_raw_setfileinfo_blob_send(tree, mem_ctx, - parms->generic.file.fnum, + parms->generic.in.file.fnum, parms->generic.level, &blob); @@ -399,7 +399,7 @@ struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree, /* send request and process the output */ req = smb_raw_setpathinfo_blob_send(tree, mem_ctx, - parms->generic.file.path, + parms->generic.in.file.path, parms->generic.level, &blob); diff --git a/source4/libcli/smb2/getinfo.c b/source4/libcli/smb2/getinfo.c index 3710fdfa08..d52ff03922 100644 --- a/source4/libcli/smb2/getinfo.c +++ b/source4/libcli/smb2/getinfo.c @@ -118,7 +118,7 @@ struct smb2_request *smb2_getinfo_file_send(struct smb2_tree *tree, union smb_fi ZERO_STRUCT(b); b.in.max_response_size = 0x10000; - b.in.handle = io->generic.file.handle; + b.in.handle = io->generic.in.file.handle; b.in.level = smb2_level; if (io->generic.level == RAW_FILEINFO_SEC_DESC) { diff --git a/source4/libcli/smb2/setinfo.c b/source4/libcli/smb2/setinfo.c index ce03a69482..c445880440 100644 --- a/source4/libcli/smb2/setinfo.c +++ b/source4/libcli/smb2/setinfo.c @@ -92,7 +92,7 @@ struct smb2_request *smb2_setinfo_file_send(struct smb2_tree *tree, union smb_se ZERO_STRUCT(b); b.in.level = smb2_level; - b.in.handle = io->generic.file.handle; + b.in.handle = io->generic.in.file.handle; if (!smb_raw_setfileinfo_passthru(tree, io->generic.level, io, &b.in.blob)) { return NULL; } diff --git a/source4/libcli/smb_composite/appendacl.c b/source4/libcli/smb_composite/appendacl.c index b09acfaf63..55aa727729 100644 --- a/source4/libcli/smb_composite/appendacl.c +++ b/source4/libcli/smb_composite/appendacl.c @@ -37,7 +37,7 @@ static NTSTATUS appendacl_open(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(state->io_fileinfo); state->io_fileinfo->query_secdesc.level = RAW_FILEINFO_SEC_DESC; - state->io_fileinfo->query_secdesc.file.fnum = state->io_open->ntcreatex.file.fnum; + state->io_fileinfo->query_secdesc.in.file.fnum = state->io_open->ntcreatex.out.file.fnum; state->io_fileinfo->query_secdesc.in.secinfo_flags = SECINFO_DACL; state->req = smb_raw_fileinfo_send(tree, state->io_fileinfo); @@ -69,7 +69,7 @@ static NTSTATUS appendacl_get(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(state->io_setfileinfo); state->io_setfileinfo->set_secdesc.level = RAW_SFILEINFO_SEC_DESC; - state->io_setfileinfo->set_secdesc.file.fnum = state->io_fileinfo->query_secdesc.file.fnum; + state->io_setfileinfo->set_secdesc.in.file.fnum = state->io_fileinfo->query_secdesc.in.file.fnum; state->io_setfileinfo->set_secdesc.in.secinfo_flags = SECINFO_DACL; state->io_setfileinfo->set_secdesc.in.sd = state->io_fileinfo->query_secdesc.out.sd; @@ -115,7 +115,7 @@ static NTSTATUS appendacl_set(struct composite_context *c, state->io_fileinfo->query_secdesc.level = RAW_FILEINFO_SEC_DESC; - state->io_fileinfo->query_secdesc.file.fnum = state->io_setfileinfo->set_secdesc.file.fnum; + state->io_fileinfo->query_secdesc.in.file.fnum = state->io_setfileinfo->set_secdesc.in.file.fnum; state->io_fileinfo->query_secdesc.in.secinfo_flags = SECINFO_DACL; state->req = smb_raw_fileinfo_send(tree, state->io_fileinfo); @@ -150,7 +150,7 @@ static NTSTATUS appendacl_getagain(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(io_close); io_close->close.level = RAW_CLOSE_CLOSE; - io_close->close.file.fnum = state->io_fileinfo->query_secdesc.file.fnum; + io_close->close.in.file.fnum = state->io_fileinfo->query_secdesc.in.file.fnum; io_close->close.in.write_time = 0; state->req = smb_raw_close_send(tree, io_close); diff --git a/source4/libcli/smb_composite/loadfile.c b/source4/libcli/smb_composite/loadfile.c index db074bfd2b..8582b71ef4 100644 --- a/source4/libcli/smb_composite/loadfile.c +++ b/source4/libcli/smb_composite/loadfile.c @@ -54,7 +54,7 @@ static NTSTATUS setup_close(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(io_close); io_close->close.level = RAW_CLOSE_CLOSE; - io_close->close.file.fnum = fnum; + io_close->close.in.file.fnum = fnum; io_close->close.in.write_time = 0; state->req = smb_raw_close_send(tree, io_close); @@ -93,7 +93,7 @@ static NTSTATUS loadfile_open(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(io->out.data); if (io->out.size == 0) { - return setup_close(c, tree, state->io_open->ntcreatex.file.fnum); + return setup_close(c, tree, state->io_open->ntcreatex.out.file.fnum); } /* setup for the read */ @@ -101,7 +101,7 @@ static NTSTATUS loadfile_open(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(state->io_read); state->io_read->readx.level = RAW_READ_READX; - state->io_read->readx.file.fnum = state->io_open->ntcreatex.file.fnum; + state->io_read->readx.in.file.fnum = state->io_open->ntcreatex.out.file.fnum; state->io_read->readx.in.offset = 0; state->io_read->readx.in.mincnt = MIN(32768, io->out.size); state->io_read->readx.in.maxcnt = state->io_read->readx.in.mincnt; @@ -140,7 +140,7 @@ static NTSTATUS loadfile_read(struct composite_context *c, /* we might be done */ if (state->io_read->readx.in.offset + state->io_read->readx.out.nread == io->out.size) { - return setup_close(c, tree, state->io_read->readx.file.fnum); + return setup_close(c, tree, state->io_read->readx.in.file.fnum); } /* setup for the next read */ diff --git a/source4/libcli/smb_composite/savefile.c b/source4/libcli/smb_composite/savefile.c index 89a2d26c0c..d355cf1e26 100644 --- a/source4/libcli/smb_composite/savefile.c +++ b/source4/libcli/smb_composite/savefile.c @@ -55,7 +55,7 @@ static NTSTATUS setup_close(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(io_close); io_close->close.level = RAW_CLOSE_CLOSE; - io_close->close.file.fnum = fnum; + io_close->close.in.file.fnum = fnum; io_close->close.in.write_time = 0; state->req = smb_raw_close_send(tree, io_close); @@ -86,7 +86,7 @@ static NTSTATUS savefile_open(struct composite_context *c, NT_STATUS_NOT_OK_RETURN(status); if (io->in.size == 0) { - return setup_close(c, tree, state->io_open->ntcreatex.file.fnum); + return setup_close(c, tree, state->io_open->ntcreatex.out.file.fnum); } /* setup for the first write */ @@ -94,7 +94,7 @@ static NTSTATUS savefile_open(struct composite_context *c, NT_STATUS_HAVE_NO_MEMORY(io_write); io_write->writex.level = RAW_WRITE_WRITEX; - io_write->writex.file.fnum = state->io_open->ntcreatex.file.fnum; + io_write->writex.in.file.fnum = state->io_open->ntcreatex.out.file.fnum; io_write->writex.in.offset = 0; io_write->writex.in.wmode = 0; io_write->writex.in.remaining = 0; @@ -135,7 +135,7 @@ static NTSTATUS savefile_write(struct composite_context *c, /* we might be done */ if (state->io_write->writex.out.nwritten != state->io_write->writex.in.count || state->total_written == io->in.size) { - return setup_close(c, tree, state->io_write->writex.file.fnum); + return setup_close(c, tree, state->io_write->writex.in.file.fnum); } /* setup for the next write */ |