summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-10 20:49:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:56:57 -0500
commit307e43bb5628e8b53a930c2928279af994281ba5 (patch)
tree68fa41cf4e697ae94b23cedab5eb7013932fc88d /source4/libcli
parent2b3767b1fe7744f0412531e1522e1d5af5dc39c6 (diff)
downloadsamba-307e43bb5628e8b53a930c2928279af994281ba5.tar.gz
samba-307e43bb5628e8b53a930c2928279af994281ba5.tar.bz2
samba-307e43bb5628e8b53a930c2928279af994281ba5.zip
r14173: change smb interface structures to always use
a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/clifile.c44
-rw-r--r--source4/libcli/clireadwrite.c6
-rw-r--r--source4/libcli/clitrans2.c10
-rw-r--r--source4/libcli/raw/interfaces.h280
-rw-r--r--source4/libcli/raw/rawacl.c4
-rw-r--r--source4/libcli/raw/rawfile.c67
-rw-r--r--source4/libcli/raw/rawfileinfo.c8
-rw-r--r--source4/libcli/raw/rawioctl.c4
-rw-r--r--source4/libcli/raw/rawnotify.c28
-rw-r--r--source4/libcli/raw/rawreadwrite.c18
-rw-r--r--source4/libcli/smb2/getinfo.c6
-rw-r--r--source4/libcli/smb_composite/appendacl.c12
-rw-r--r--source4/libcli/smb_composite/loadfile.c8
-rw-r--r--source4/libcli/smb_composite/savefile.c8
14 files changed, 252 insertions, 251 deletions
diff --git a/source4/libcli/clifile.c b/source4/libcli/clifile.c
index e8cb548007..d3de0dab77 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.fname = fname_src;
+ parms.unix_hlink.file.path = fname_src;
parms.unix_hlink.in.link_dest = fname_dst;
} else {
parms.generic.level = RAW_SFILEINFO_UNIX_LINK;
- parms.unix_link.file.fname = fname_src;
+ parms.unix_link.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.fname = fname;
+ parms.unix_basic.file.path = fname;
parms.unix_basic.in.uid = uid;
parms.unix_basic.in.gid = gid;
parms.unix_basic.in.mode = mode;
@@ -165,13 +165,13 @@ NTSTATUS smbcli_rename(struct smbcli_tree *tree, const char *fname_src,
****************************************************************************/
NTSTATUS smbcli_unlink(struct smbcli_tree *tree, const char *fname)
{
- struct smb_unlink parms;
+ union smb_unlink parms;
- parms.in.pattern = fname;
+ parms.unlink.in.pattern = fname;
if (strchr(fname, '*')) {
- parms.in.attrib = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
+ parms.unlink.in.attrib = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
} else {
- parms.in.attrib = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY;
+ parms.unlink.in.attrib = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY;
}
return smb_raw_unlink(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.out.fnum;
+ return open_parms.ntcreatex.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.out.fnum;
+ return open_parms.openx.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.in.fnum = fnum;
+ close_parms.close.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.in.fnum = fnum;
+ parms.lockx.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.in.fnum = fnum;
+ parms.lockx.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.in.fnum = fnum;
+ parms.lockx.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.in.fnum = fnum;
+ parms.lockx.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.in.fnum = fnum;
+ parms.lockx.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.in.fnum = fnum;
+ parms.getattre.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.in.fname = fname;
+ parms.getattr.file.path = fname;
status = smb_raw_pathinfo(tree, NULL, &parms);
@@ -579,9 +579,9 @@ 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.attrib = mode;
parms.setattr.in.write_time = t;
- parms.setattr.file.fname = fname;
status = smb_raw_setpathinfo(tree, &parms);
@@ -594,7 +594,7 @@ NTSTATUS smbcli_setatr(struct smbcli_tree *tree, const char *fname, uint16_t mod
****************************************************************************/
NTSTATUS smbcli_chkpath(struct smbcli_tree *tree, const char *path)
{
- struct smb_chkpath parms;
+ union smb_chkpath parms;
char *path2;
NTSTATUS status;
@@ -605,8 +605,8 @@ NTSTATUS smbcli_chkpath(struct smbcli_tree *tree, const char *path)
path2 = strdup("\\");
}
- parms.in.path = path2;
-
+ parms.chkpath.in.path = path2;
+
status = smb_raw_chkpath(tree, &parms);
free(path2);
@@ -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.out.fnum;
+ return open_parms.ctemp.file.fnum;
}
return -1;
}
diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c
index 4248ac4286..afffba968a 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.in.fnum = fnum;
+ parms.readx.file.fnum = fnum;
/*
* Set readsize to the maximum size we can handle in one readX,
@@ -100,7 +100,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree,
parms.writex.level = RAW_WRITE_WRITEX;
- parms.writex.in.fnum = fnum;
+ parms.writex.file.fnum = fnum;
parms.writex.in.wmode = write_mode;
parms.writex.in.remaining = 0;
@@ -144,7 +144,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.in.fnum = fnum;
+ parms.write.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 c440b25e36..f8699e0191 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.in.fname = fname;
+ parms.standard.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.in.fname = fname;
+ parms.all_info.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.in.fnum = fnum;
+ parms.name_info.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.in.fnum = fnum;
+ parms.all_info.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.in.fname = fname;
+ parms.alt_name_info.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 034878a464..0505078fd4 100644
--- a/source4/libcli/raw/interfaces.h
+++ b/source4/libcli/raw/interfaces.h
@@ -56,6 +56,29 @@ typedef struct {
/* same struct as dom_sid but inside a 28 bytes fixed buffer in NDR */
#define dom_sid28 dom_sid
+/*
+ a generic container for file handles
+*/
+union smb_file {
+ /*
+ * this is only 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 {
+ uint64_t data[2];
+ } handle;
+};
/*
this header defines the structures and unions used between the SMB
@@ -63,32 +86,37 @@ typedef struct {
*/
/* struct used for SMBlseek call */
-struct smb_seek {
- struct {
- uint16_t fnum;
- uint16_t mode;
- int32_t offset; /* signed */
- } in;
+union smb_seek {
struct {
- int32_t offset;
- } out;
+ union smb_file file;
+ struct {
+ uint16_t mode;
+ int32_t offset; /* signed */
+ } in;
+ struct {
+ int32_t offset;
+ } out;
+ } lseek;
};
-
/* struct used in unlink() call */
-struct smb_unlink {
+union smb_unlink {
struct {
- const char *pattern;
- uint16_t attrib;
- } in;
+ struct {
+ const char *pattern;
+ uint16_t attrib;
+ } in;
+ } unlink;
};
/* struct used in chkpath() call */
-struct smb_chkpath {
+union smb_chkpath {
struct {
- const char *path;
- } in;
+ struct {
+ const char *path;
+ } in;
+ } chkpath;
};
enum smb_mkdir_level {RAW_MKDIR_GENERIC, RAW_MKDIR_MKDIR, RAW_MKDIR_T2MKDIR};
@@ -326,32 +354,14 @@ enum smb_fileinfo_level {
RAW_FILEINFO_SMB2_ALL_INFORMATION = 0x1201
};
-/*
- file handles in SMB2 are 16 bytes
-*/
-struct smb2_handle {
- uint64_t data[2];
-};
-
-
/* union used in qfileinfo() and qpathinfo() backend calls */
union smb_fileinfo {
/* generic interface:
* matches RAW_FILEINFO_GENERIC */
struct {
enum smb_fileinfo_level level;
+ union smb_file file;
- /* each level can be called on either a pathname or a
- filename, in either case the return format is
- identical
- On SMB2 a 16 byte handle is used
- */
- union smb_fileinfo_in {
- const char *fname;
- uint16_t fnum;
- struct smb2_handle handle;
- } in;
-
struct {
uint32_t attrib;
uint32_t ea_size;
@@ -397,7 +407,7 @@ union smb_fileinfo {
* matches RAW_FILEINFO_GETATTR */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint16_t attrib;
@@ -409,7 +419,7 @@ union smb_fileinfo {
/* SMBgetattrE and RAW_FILEINFO_STANDARD interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
time_t create_time;
@@ -424,7 +434,7 @@ union smb_fileinfo {
/* trans2 RAW_FILEINFO_EA_SIZE interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
time_t create_time;
@@ -440,7 +450,7 @@ union smb_fileinfo {
/* trans2 RAW_FILEINFO_EA_LIST interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in file;
+ union smb_file file;
struct {
uint_t num_names;
@@ -458,9 +468,11 @@ union smb_fileinfo {
/* trans2 RAW_FILEINFO_ALL_EAS and RAW_FILEINFO_FULL_EA_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
- uint8_t continue_flags; /* SMB2 only - SMB2_CONTINUE_FLAG_* */
-
+ union smb_file file;
+ struct {
+ /* SMB2 only - SMB2_CONTINUE_FLAG_* */
+ uint8_t continue_flags;
+ } in;
struct smb_ea_list out;
} all_eas;
@@ -468,13 +480,13 @@ union smb_fileinfo {
only valid for a QPATHNAME call - no returned data */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
} is_name_valid;
/* RAW_FILEINFO_BASIC_INFO and RAW_FILEINFO_BASIC_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
NTTIME create_time;
@@ -489,7 +501,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_STANDARD_INFO and RAW_FILEINFO_STANDARD_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint64_t alloc_size;
@@ -503,7 +515,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_EA_INFO and RAW_FILEINFO_EA_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint32_t ea_size;
@@ -513,7 +525,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_NAME_INFO and RAW_FILEINFO_NAME_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
WIRE_STRING fname;
@@ -523,7 +535,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_ALL_INFO and RAW_FILEINFO_ALL_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
NTTIME create_time;
@@ -544,7 +556,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_SMB2_ALL_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
NTTIME create_time;
@@ -571,7 +583,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_ALT_NAME_INFO and RAW_FILEINFO_ALT_NAME_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
WIRE_STRING fname;
@@ -581,7 +593,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_STREAM_INFO and RAW_FILEINFO_STREAM_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct stream_information {
uint_t num_streams;
@@ -592,7 +604,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_COMPRESSION_INFO and RAW_FILEINFO_COMPRESSION_INFORMATION interfaces */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint64_t compressed_size;
@@ -606,7 +618,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_UNIX_BASIC interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint64_t end_of_file;
@@ -628,7 +640,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_UNIX_LINK interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
WIRE_STRING link_dest;
@@ -638,7 +650,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_INTERNAL_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint64_t file_id;
@@ -648,7 +660,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_ACCESS_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint32_t access_flags;
@@ -658,7 +670,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_POSITION_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint64_t position;
@@ -668,7 +680,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_MODE_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint32_t mode;
@@ -678,7 +690,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_ALIGNMENT_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint32_t alignment_requirement;
@@ -688,7 +700,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_NETWORK_OPEN_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
NTTIME create_time;
@@ -705,7 +717,7 @@ union smb_fileinfo {
/* RAW_FILEINFO_ATTRIBUTE_TAG_INFORMATION interface */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
+ union smb_file file;
struct {
uint32_t attrib;
@@ -716,8 +728,10 @@ union smb_fileinfo {
/* RAW_FILEINFO_SEC_DESC */
struct {
enum smb_fileinfo_level level;
- union smb_fileinfo_in in;
- uint32_t secinfo_flags;
+ union smb_file file;
+ struct {
+ uint32_t secinfo_flags;
+ } in;
struct {
struct security_descriptor *sd;
} out;
@@ -760,19 +774,13 @@ union smb_setfileinfo {
struct {
enum smb_setfileinfo_level level;
- /* we are combining setfileinfo and setpathinfo into one
- interface */
- union setfileinfo_file {
- const char *fname;
- uint16_t fnum;
- struct smb2_handle handle; /* only for SMB2 */
- } file;
+ union smb_file file;
} generic;
/* RAW_SFILEINFO_SETATTR (SMBsetatr) interface - only via setpathinfo() */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
+ union smb_file file;
struct {
uint16_t attrib;
time_t write_time;
@@ -783,8 +791,7 @@ union smb_setfileinfo {
also RAW_SFILEINFO_STANDARD */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
time_t create_time;
time_t access_time;
@@ -797,7 +804,7 @@ union smb_setfileinfo {
/* RAW_SFILEINFO_EA_SET interface */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
+ union smb_file file;
struct {
uint_t num_eas;
struct ea_struct *eas;
@@ -808,8 +815,7 @@ union smb_setfileinfo {
RAW_SFILEINFO_BASIC_INFORMATION interfaces */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
NTTIME create_time;
NTTIME access_time;
@@ -823,8 +829,7 @@ union smb_setfileinfo {
RAW_SFILEINFO_DISPOSITION_INFORMATION interfaces */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
BOOL delete_on_close;
} in;
@@ -834,8 +839,7 @@ union smb_setfileinfo {
RAW_SFILEINFO_ALLOCATION_INFORMATION interfaces */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
/* w2k3 rounds this up to nearest 4096 */
uint64_t alloc_size;
@@ -846,8 +850,7 @@ union smb_setfileinfo {
RAW_SFILEINFO_END_OF_FILE_INFORMATION interfaces */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
uint64_t size;
} in;
@@ -856,8 +859,7 @@ union smb_setfileinfo {
/* RAW_SFILEINFO_RENAME_INFORMATION interface */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct smb_rename_information {
uint8_t overwrite;
uint32_t root_fid;
@@ -868,8 +870,7 @@ union smb_setfileinfo {
/* RAW_SFILEINFO_POSITION_INFORMATION interface */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
uint64_t position;
} in;
@@ -878,8 +879,7 @@ union smb_setfileinfo {
/* RAW_SFILEINFO_MODE_INFORMATION interface */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
-
+ union smb_file file;
struct {
/* valid values seem to be 0, 2, 4 and 6 */
uint32_t mode;
@@ -891,7 +891,7 @@ union smb_setfileinfo {
/* RAW_SFILEINFO_UNIX_BASIC interface */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
+ union smb_file file;
struct {
uint32_t mode; /* yuck - this field remains to fix compile of libcli/clifile.c */
uint64_t end_of_file;
@@ -913,7 +913,7 @@ union smb_setfileinfo {
/* RAW_SFILEINFO_UNIX_LINK, RAW_SFILEINFO_UNIX_HLINK interface */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
+ union smb_file file;
struct {
const char *link_dest;
} in;
@@ -922,7 +922,7 @@ union smb_setfileinfo {
/* RAW_FILEINFO_SET_SEC_DESC */
struct {
enum smb_setfileinfo_level level;
- union setfileinfo_file file;
+ union smb_file file;
struct {
uint32_t secinfo_flags;
struct security_descriptor *sd;
@@ -1131,6 +1131,8 @@ 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;
@@ -1156,7 +1158,6 @@ union smb_open {
struct {
uint8_t oplock_level;
- uint16_t fnum;
uint32_t create_action;
NTTIME create_time;
NTTIME access_time;
@@ -1174,6 +1175,8 @@ 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;
@@ -1190,7 +1193,6 @@ union smb_open {
} in;
struct {
- uint16_t fnum;
uint16_t attrib;
time_t write_time;
uint32_t size;
@@ -1205,14 +1207,16 @@ 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 {
- uint16_t fnum;
uint16_t attrib;
time_t write_time;
uint32_t size;
@@ -1223,6 +1227,8 @@ 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;
@@ -1238,7 +1244,6 @@ union smb_open {
const char *fname;
} in;
struct {
- uint16_t fnum;
uint16_t attrib;
time_t write_time;
uint32_t size;
@@ -1255,20 +1260,21 @@ 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 {
- uint16_t fnum;
- } 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;
@@ -1276,7 +1282,6 @@ union smb_open {
const char *directory;
} in;
struct {
- uint16_t fnum;
/* temp name, relative to directory */
char *name;
} out;
@@ -1285,21 +1290,22 @@ 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 {
- uint16_t fnum;
- } 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;
@@ -1321,7 +1327,6 @@ union smb_open {
uint16_t remaining;
} in;
struct {
- uint16_t fnum;
uint16_t attrib;
time_t write_time;
uint32_t size;
@@ -1357,9 +1362,9 @@ union smb_read {
/* SMBreadX (and generic) interface */
struct {
enum smb_read_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint64_t offset;
uint16_t mincnt;
uint32_t maxcnt;
@@ -1376,9 +1381,9 @@ union smb_read {
/* SMBreadbraw interface */
struct {
enum smb_read_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint64_t offset;
uint16_t maxcnt;
uint16_t mincnt;
@@ -1394,9 +1399,9 @@ union smb_read {
/* SMBlockandread interface */
struct {
enum smb_read_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t count;
uint32_t offset;
uint16_t remaining;
@@ -1410,9 +1415,9 @@ union smb_read {
/* SMBread interface */
struct {
enum smb_read_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t count;
uint32_t offset;
uint16_t remaining;
@@ -1437,9 +1442,9 @@ union smb_write {
/* SMBwriteX interface */
struct {
enum smb_write_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint64_t offset;
uint16_t wmode;
uint16_t remaining;
@@ -1455,9 +1460,9 @@ union smb_write {
/* SMBwriteunlock interface */
struct {
enum smb_write_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t count;
uint32_t offset;
uint16_t remaining;
@@ -1471,9 +1476,9 @@ union smb_write {
/* SMBwrite interface */
struct {
enum smb_write_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t count;
uint32_t offset;
uint16_t remaining;
@@ -1487,9 +1492,9 @@ union smb_write {
/* SMBwriteclose interface */
struct {
enum smb_write_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t count;
uint32_t offset;
time_t mtime;
@@ -1503,9 +1508,9 @@ union smb_write {
/* SMBsplwrite interface */
struct {
enum smb_write_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t count;
const uint8_t *data;
} in;
@@ -1524,9 +1529,9 @@ union smb_lock {
/* SMBlockingX (and generic) interface */
struct {
enum smb_lock_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint16_t mode;
uint32_t timeout;
uint16_t ulock_cnt;
@@ -1542,9 +1547,9 @@ union smb_lock {
/* SMBlock and SMBunlock interface */
struct {
enum smb_lock_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint32_t count;
uint32_t offset;
} in;
@@ -1563,9 +1568,9 @@ union smb_close {
/* SMBclose (and generic) interface */
struct {
enum smb_close_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
time_t write_time;
} in;
} close, generic;
@@ -1573,10 +1578,7 @@ union smb_close {
/* SMBsplclose interface - empty! */
struct {
enum smb_close_level level;
-
- struct {
- uint16_t fnum;
- } in;
+ union smb_file file;
} splclose;
};
@@ -1625,14 +1627,15 @@ union smb_ioctl {
/* generic interface */
struct {
enum smb_ioctl_level level;
+ union smb_file file;
} generic;
/* struct for SMBioctl */
struct {
enum smb_ioctl_level level;
+ union smb_file file;
struct {
- uint16_t fnum;
uint32_t request;
} in;
struct {
@@ -1644,9 +1647,9 @@ union smb_ioctl {
/* struct for NT ioctl call */
struct {
enum smb_ioctl_level level;
+ union smb_file file;
struct {
uint32_t function;
- uint16_t fnum;
BOOL fsctl;
uint8_t filter;
} in;
@@ -1657,10 +1660,10 @@ union smb_ioctl {
};
/* struct for SMBflush */
-struct smb_flush {
+union smb_flush {
struct {
- uint16_t fnum;
- } in;
+ union smb_file file;
+ } flush;
};
@@ -1725,24 +1728,25 @@ struct smb_nttrans {
/* struct for nttrans change notify call */
-struct smb_notify {
+union smb_notify {
struct {
- uint32_t buffer_size;
- uint32_t completion_filter;
- uint16_t fnum;
- BOOL recursive;
- } in;
+ union smb_file file;
+ struct {
+ uint32_t buffer_size;
+ uint32_t completion_filter;
+ BOOL recursive;
+ } in;
- struct {
- uint32_t num_changes;
- struct notify_changes {
- uint32_t action;
- WIRE_STRING name;
- } *changes;
- } out;
+ struct {
+ uint32_t num_changes;
+ struct notify_changes {
+ uint32_t action;
+ WIRE_STRING name;
+ } *changes;
+ } out;
+ } notify;
};
-
enum smb_search_level {RAW_SEARCH_GENERIC = 0xF000,
RAW_SEARCH_SEARCH, /* SMBsearch */
RAW_SEARCH_FFIRST, /* SMBffirst */
diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c
index 08515eadde..7c0c17b4d7 100644
--- a/source4/libcli/raw/rawacl.c
+++ b/source4/libcli/raw/rawacl.c
@@ -38,9 +38,9 @@ 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.in.fnum);
+ SSVAL(params, 0, io->query_secdesc.file.fnum);
SSVAL(params, 2, 0); /* padding */
- SIVAL(params, 4, io->query_secdesc.secinfo_flags);
+ SIVAL(params, 4, io->query_secdesc.in.secinfo_flags);
nt.in.params.data = params;
nt.in.params.length = 8;
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index 9d2611f7b2..0e63fa656f 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -78,14 +78,14 @@ NTSTATUS smb_raw_rename(struct smbcli_tree *tree,
Delete a file - async interface
****************************************************************************/
struct smbcli_request *smb_raw_unlink_send(struct smbcli_tree *tree,
- struct smb_unlink *parms)
+ union smb_unlink *parms)
{
struct smbcli_request *req;
SETUP_REQUEST(SMBunlink, 1, 0);
- SSVAL(req->out.vwv, VWV(0), parms->in.attrib);
- smbcli_req_append_ascii4(req, parms->in.pattern, STR_TERMINATE);
+ SSVAL(req->out.vwv, VWV(0), parms->unlink.in.attrib);
+ smbcli_req_append_ascii4(req, parms->unlink.in.pattern, STR_TERMINATE);
if (!smbcli_request_send(req)) {
smbcli_request_destroy(req);
@@ -98,7 +98,7 @@ struct smbcli_request *smb_raw_unlink_send(struct smbcli_tree *tree,
delete a file - sync interface
*/
NTSTATUS smb_raw_unlink(struct smbcli_tree *tree,
- struct smb_unlink *parms)
+ union smb_unlink *parms)
{
struct smbcli_request *req = smb_raw_unlink_send(tree, parms);
return smbcli_request_simple_recv(req);
@@ -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.out.fnum = SVAL(params, 2);
+ parms->ntcreatex.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.out.fnum = SVAL(t2.out.params.data, VWV(0));
+ parms->t2open.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.out.fnum = SVAL(req->in.vwv, VWV(0));
+ parms->openold.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.out.fnum = SVAL(req->in.vwv, VWV(2));
+ parms->openx.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.out.fnum = SVAL(req->in.vwv, VWV(0));
+ parms->mknew.file.fnum = SVAL(req->in.vwv, VWV(0));
break;
case RAW_OPEN_CREATE:
SMBCLI_CHECK_WCT(req, 1);
- parms->create.out.fnum = SVAL(req->in.vwv, VWV(0));
+ parms->create.file.fnum = SVAL(req->in.vwv, VWV(0));
break;
case RAW_OPEN_CTEMP:
SMBCLI_CHECK_WCT(req, 1);
- parms->ctemp.out.fnum = SVAL(req->in.vwv, VWV(0));
+ parms->ctemp.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.out.fnum = SVAL(req->in.vwv, VWV(0));
+ parms->splopen.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.out.fnum = SVAL(req->in.vwv, 5);
+ parms->ntcreatex.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.out.fnum = SVAL(req->in.vwv, VWV(2));
+ parms->openxreadx.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->close.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->splclose.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->lock.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->unlock.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(2), parms->lockx.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);
@@ -816,13 +816,13 @@ NTSTATUS smb_raw_lock(struct smbcli_tree *tree, union smb_lock *parms)
/****************************************************************************
Check for existence of a dir - async send
****************************************************************************/
-struct smbcli_request *smb_raw_chkpath_send(struct smbcli_tree *tree, struct smb_chkpath *parms)
+struct smbcli_request *smb_raw_chkpath_send(struct smbcli_tree *tree, union smb_chkpath *parms)
{
struct smbcli_request *req;
SETUP_REQUEST(SMBchkpth, 0, 0);
- smbcli_req_append_ascii4(req, parms->in.path, STR_TERMINATE);
+ smbcli_req_append_ascii4(req, parms->chkpath.in.path, STR_TERMINATE);
if (!smbcli_request_send(req)) {
smbcli_request_destroy(req);
@@ -835,25 +835,22 @@ struct smbcli_request *smb_raw_chkpath_send(struct smbcli_tree *tree, struct smb
/****************************************************************************
Check for existence of a dir - sync interface
****************************************************************************/
-NTSTATUS smb_raw_chkpath(struct smbcli_tree *tree, struct smb_chkpath *parms)
+NTSTATUS smb_raw_chkpath(struct smbcli_tree *tree, union smb_chkpath *parms)
{
struct smbcli_request *req = smb_raw_chkpath_send(tree, parms);
return smbcli_request_simple_recv(req);
}
-
-
-
/****************************************************************************
flush a file - async send
a flush to fnum 0xFFFF will flush all files
****************************************************************************/
-struct smbcli_request *smb_raw_flush_send(struct smbcli_tree *tree, struct smb_flush *parms)
+struct smbcli_request *smb_raw_flush_send(struct smbcli_tree *tree, union smb_flush *parms)
{
struct smbcli_request *req;
SETUP_REQUEST(SMBflush, 1, 0);
- SSVAL(req->out.vwv, VWV(0), parms->in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->flush.file.fnum);
if (!smbcli_request_send(req)) {
smbcli_request_destroy(req);
@@ -867,7 +864,7 @@ struct smbcli_request *smb_raw_flush_send(struct smbcli_tree *tree, struct smb_f
/****************************************************************************
flush a file - sync interface
****************************************************************************/
-NTSTATUS smb_raw_flush(struct smbcli_tree *tree, struct smb_flush *parms)
+NTSTATUS smb_raw_flush(struct smbcli_tree *tree, union smb_flush *parms)
{
struct smbcli_request *req = smb_raw_flush_send(tree, parms);
return smbcli_request_simple_recv(req);
@@ -878,15 +875,15 @@ NTSTATUS smb_raw_flush(struct smbcli_tree *tree, struct smb_flush *parms)
seek a file - async send
****************************************************************************/
struct smbcli_request *smb_raw_seek_send(struct smbcli_tree *tree,
- struct smb_seek *parms)
+ union smb_seek *parms)
{
struct smbcli_request *req;
SETUP_REQUEST(SMBlseek, 4, 0);
- SSVAL(req->out.vwv, VWV(0), parms->in.fnum);
- SSVAL(req->out.vwv, VWV(1), parms->in.mode);
- SIVALS(req->out.vwv, VWV(2), parms->in.offset);
+ SSVAL(req->out.vwv, VWV(0), parms->lseek.file.fnum);
+ SSVAL(req->out.vwv, VWV(1), parms->lseek.in.mode);
+ SIVALS(req->out.vwv, VWV(2), parms->lseek.in.offset);
if (!smbcli_request_send(req)) {
smbcli_request_destroy(req);
@@ -899,7 +896,7 @@ struct smbcli_request *smb_raw_seek_send(struct smbcli_tree *tree,
seek a file - async receive
****************************************************************************/
NTSTATUS smb_raw_seek_recv(struct smbcli_request *req,
- struct smb_seek *parms)
+ union smb_seek *parms)
{
if (!smbcli_request_receive(req) ||
smbcli_request_is_error(req)) {
@@ -907,7 +904,7 @@ NTSTATUS smb_raw_seek_recv(struct smbcli_request *req,
}
SMBCLI_CHECK_WCT(req, 2);
- parms->out.offset = IVAL(req->in.vwv, VWV(0));
+ parms->lseek.out.offset = IVAL(req->in.vwv, VWV(0));
failed:
return smbcli_request_destroy(req);
@@ -917,7 +914,7 @@ failed:
seek a file - sync interface
*/
NTSTATUS smb_raw_seek(struct smbcli_tree *tree,
- struct smb_seek *parms)
+ union smb_seek *parms)
{
struct smbcli_request *req = smb_raw_seek_send(tree, parms);
return smb_raw_seek_recv(req, parms);
diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c
index 92d31b30ef..b50a330093 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.in.fname, STR_TERMINATE);
+ smbcli_req_append_ascii4(req, parms->getattr.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->getattre.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.in.fnum,
+ parms->generic.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.in.fname,
+ req = smb_raw_pathinfo_blob_send(tree, parms->generic.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 874d055013..28b58ff2a3 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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->ioctl.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.in.fnum);
+ SSVAL(setup, 4, parms->ntioctl.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 1215a93f59..3adb1b000b 100644
--- a/source4/libcli/raw/rawnotify.c
+++ b/source4/libcli/raw/rawnotify.c
@@ -25,19 +25,19 @@
/****************************************************************************
change notify (async send)
****************************************************************************/
-struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, struct smb_notify *parms)
+struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union smb_notify *parms)
{
struct smb_nttrans nt;
uint16_t setup[4];
nt.in.max_setup = 0;
- nt.in.max_param = parms->in.buffer_size;
+ nt.in.max_param = parms->notify.in.buffer_size;
nt.in.max_data = 0;
nt.in.setup_count = 4;
nt.in.setup = setup;
- SIVAL(setup, 0, parms->in.completion_filter);
- SSVAL(setup, 4, parms->in.fnum);
- SSVAL(setup, 6, parms->in.recursive);
+ SIVAL(setup, 0, parms->notify.in.completion_filter);
+ SSVAL(setup, 4, parms->notify.file.fnum);
+ SSVAL(setup, 6, parms->notify.in.recursive);
nt.in.function = NT_TRANSACT_NOTIFY_CHANGE;
nt.in.params = data_blob(NULL, 0);
nt.in.data = data_blob(NULL, 0);
@@ -49,7 +49,7 @@ struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, struc
change notify (async recv)
****************************************************************************/
NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req,
- TALLOC_CTX *mem_ctx, struct smb_notify *parms)
+ TALLOC_CTX *mem_ctx, union smb_notify *parms)
{
struct smb_nttrans nt;
NTSTATUS status;
@@ -61,28 +61,28 @@ NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req,
return status;
}
- parms->out.changes = NULL;
- parms->out.num_changes = 0;
+ parms->notify.out.changes = NULL;
+ parms->notify.out.num_changes = 0;
/* count them */
for (ofs=0; nt.out.params.length - ofs > 12; ) {
uint32_t next = IVAL(nt.out.params.data, ofs);
- parms->out.num_changes++;
+ parms->notify.out.num_changes++;
if (next == 0 ||
ofs + next >= nt.out.params.length) break;
ofs += next;
}
/* allocate array */
- parms->out.changes = talloc_array(mem_ctx, struct notify_changes, parms->out.num_changes);
- if (!parms->out.changes) {
+ parms->notify.out.changes = talloc_array(mem_ctx, struct notify_changes, parms->notify.out.num_changes);
+ if (!parms->notify.out.changes) {
return NT_STATUS_NO_MEMORY;
}
- for (i=ofs=0; i<parms->out.num_changes; i++) {
- parms->out.changes[i].action = IVAL(nt.out.params.data, ofs+4);
+ for (i=ofs=0; i<parms->notify.out.num_changes; i++) {
+ parms->notify.out.changes[i].action = IVAL(nt.out.params.data, ofs+4);
smbcli_blob_pull_string(session, mem_ctx, &nt.out.params,
- &parms->out.changes[i].name,
+ &parms->notify.out.changes[i].name,
ofs+8, ofs+12, STR_UNICODE);
ofs += IVAL(nt.out.params.data, ofs);
}
diff --git a/source4/libcli/raw/rawreadwrite.c b/source4/libcli/raw/rawreadwrite.c
index d9fe3fdce0..00dc71971e 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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->readbraw.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->lockread.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->read.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.in.fnum);
+ SSVAL(req->out.vwv, VWV(2), parms->readx.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);
@@ -183,7 +183,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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->writeunlock.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);
@@ -197,7 +197,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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->write.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);
@@ -210,7 +210,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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->writeclose.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,
@@ -229,7 +229,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.in.fnum);
+ SSVAL(req->out.vwv, VWV(2), parms->writex.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);
@@ -247,7 +247,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.in.fnum);
+ SSVAL(req->out.vwv, VWV(0), parms->splwrite.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/smb2/getinfo.c b/source4/libcli/smb2/getinfo.c
index e406fdf45c..3710fdfa08 100644
--- a/source4/libcli/smb2/getinfo.c
+++ b/source4/libcli/smb2/getinfo.c
@@ -118,14 +118,14 @@ 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.in.handle;
+ b.in.handle = io->generic.file.handle;
b.in.level = smb2_level;
if (io->generic.level == RAW_FILEINFO_SEC_DESC) {
- b.in.flags = io->query_secdesc.secinfo_flags;
+ b.in.flags = io->query_secdesc.in.secinfo_flags;
}
if (io->generic.level == RAW_FILEINFO_SMB2_ALL_EAS) {
- b.in.flags2 = io->all_eas.continue_flags;
+ b.in.flags2 = io->all_eas.in.continue_flags;
}
return smb2_getinfo_send(tree, &b);
diff --git a/source4/libcli/smb_composite/appendacl.c b/source4/libcli/smb_composite/appendacl.c
index 0a5b56b90d..b09acfaf63 100644
--- a/source4/libcli/smb_composite/appendacl.c
+++ b/source4/libcli/smb_composite/appendacl.c
@@ -37,8 +37,8 @@ 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.in.fnum = state->io_open->ntcreatex.out.fnum;
- state->io_fileinfo->query_secdesc.secinfo_flags = SECINFO_DACL;
+ state->io_fileinfo->query_secdesc.file.fnum = state->io_open->ntcreatex.file.fnum;
+ state->io_fileinfo->query_secdesc.in.secinfo_flags = SECINFO_DACL;
state->req = smb_raw_fileinfo_send(tree, state->io_fileinfo);
NT_STATUS_HAVE_NO_MEMORY(state->req);
@@ -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.in.fnum;
+ state->io_setfileinfo->set_secdesc.file.fnum = state->io_fileinfo->query_secdesc.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,8 +115,8 @@ static NTSTATUS appendacl_set(struct composite_context *c,
state->io_fileinfo->query_secdesc.level = RAW_FILEINFO_SEC_DESC;
- state->io_fileinfo->query_secdesc.in.fnum = state->io_setfileinfo->set_secdesc.file.fnum;
- state->io_fileinfo->query_secdesc.secinfo_flags = SECINFO_DACL;
+ state->io_fileinfo->query_secdesc.file.fnum = state->io_setfileinfo->set_secdesc.file.fnum;
+ state->io_fileinfo->query_secdesc.in.secinfo_flags = SECINFO_DACL;
state->req = smb_raw_fileinfo_send(tree, state->io_fileinfo);
NT_STATUS_HAVE_NO_MEMORY(state->req);
@@ -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.in.fnum = state->io_fileinfo->query_secdesc.in.fnum;
+ io_close->close.file.fnum = state->io_fileinfo->query_secdesc.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 2551b6da9e..9a593c0726 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.in.fnum = fnum;
+ io_close->close.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.out.fnum);
+ return setup_close(c, tree, state->io_open->ntcreatex.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.in.fnum = state->io_open->ntcreatex.out.fnum;
+ state->io_read->readx.file.fnum = state->io_open->ntcreatex.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;
@@ -139,7 +139,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.in.fnum);
+ return setup_close(c, tree, state->io_read->readx.file.fnum);
}
/* setup for the next read */
diff --git a/source4/libcli/smb_composite/savefile.c b/source4/libcli/smb_composite/savefile.c
index 9600af97d2..89a2d26c0c 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.in.fnum = fnum;
+ io_close->close.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.out.fnum);
+ return setup_close(c, tree, state->io_open->ntcreatex.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.in.fnum = state->io_open->ntcreatex.out.fnum;
+ io_write->writex.file.fnum = state->io_open->ntcreatex.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.in.fnum);
+ return setup_close(c, tree, state->io_write->writex.file.fnum);
}
/* setup for the next write */