On Fri, Apr 12, 2019 at 3:49 AM Pavel Shilovsky piastryyy@gmail.com wrote:
ср, 10 апр. 2019 г. в 19:21, Ronnie Sahlberg lsahlber@redhat.com:
Add support to pass a blob to the server in FSCTL passthrough.
Signed-off-by: Ronnie Sahlberg lsahlber@redhat.com
fs/cifs/smb2ops.c | 17 +++++++++++++++-- fs/cifs/smbfsctl.h | 27 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 83a100dd2497..bb7522b882ea 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1382,6 +1382,18 @@ smb2_ioctl_query_info(const unsigned int xid, oparms.fid = &fid; oparms.reconnect = false;
/*
* FSCTL codes encode the special access they need in the fsctl code.
*/
if (qi.flags & PASSTHRU_FSCTL) {
switch (qi.info_type & FSCTL_DEVICE_ACCESS_MASK) {
case FSCTL_DEVICE_ACCESS_FILE_READ_WRITE_ACCESS:
oparms.desired_access = FILE_READ_DATA | FILE_WRITE_DATA | FILE_READ_ATTRIBUTES | SYNCHRONIZE;
;
This extra ":" looks unnecessary. Don't we need to add cases for +#define FSCTL_DEVICE_ACCESS_FILE_ANY_ACCESS (0x00 << 14) +#define FSCTL_DEVICE_ACCESS_FILE_READ_ACCESS (0x01 << 14) +#define FSCTL_DEVICE_ACCESS_FILE_WRITE_ACCESS (0x02 << 14) ?
Thanks, yeah that ';' should go. We should add cases for the other three DEVICE_ACCESS cases but i don't know yet how these are mapped on windows. READ_WRITE was based on what win16 used as desired_access for this.
We can add the others later when we start adding other fsctl types when we compare to what windows uses.
-- Best regards, Pavel Shilovsky