diff options
author | ouyang.xu <ouyang.xu@test2.develop.cn> | 2016-07-11 18:12:52 +0800 |
---|---|---|
committer | Uri Simchoni <uri@samba.org> | 2016-08-19 09:35:14 +0200 |
commit | 98ea4a2219c4ff1c1a8307f64a7588845be7af6f (patch) | |
tree | adf451118e2e9b21790cedfda39f29996a2c1149 | |
parent | 23b4fb681aa7c02450d0ebb06af87943163b959b (diff) | |
download | samba-98ea4a2219c4ff1c1a8307f64a7588845be7af6f.tar.gz |
pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID
Signed-off-by: kkhaike <kkhaike@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 09:35:15 CEST 2016 on sn-devel-144
-rw-r--r-- | source4/libcli/raw/interfaces.h | 4 | ||||
-rw-r--r-- | source4/ntvfs/ntvfs_generic.c | 3 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 18 | ||||
-rw-r--r-- | source4/smb_server/smb/nttrans.c | 1 | ||||
-rw-r--r-- | source4/smb_server/smb/reply.c | 1 | ||||
-rw-r--r-- | source4/smb_server/smb2/fileio.c | 5 |
6 files changed, 31 insertions, 1 deletions
diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h index 7e8258e9f8b..732ba1512dc 100644 --- a/source4/libcli/raw/interfaces.h +++ b/source4/libcli/raw/interfaces.h @@ -1464,9 +1464,10 @@ union smb_open { NTTRANS varient of the call */ struct security_descriptor *sec_desc; struct smb_ea_list *ea_list; - + /* some optional parameters from the SMB2 varient */ bool query_maximal_access; + bool query_on_disk_id; /* private flags for internal use only */ uint8_t private_flags; @@ -1489,6 +1490,7 @@ union smb_open { /* optional return values matching SMB2 tagged values in the call */ uint32_t maximal_access; + uint8_t on_disk_id[32]; } out; } ntcreatex, nttrans, generic; diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 4edc31c22cc..fe68b4132bc 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -236,6 +236,8 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs, io->smb2.out.file_attr = io2->generic.out.attrib; io->smb2.out.reserved2 = 0; io->smb2.out.maximal_access = io2->generic.out.maximal_access; + memcpy(io->smb2.out.on_disk_id, io2->generic.out.on_disk_id, + sizeof(io2->generic.out.on_disk_id)); break; default: @@ -529,6 +531,7 @@ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs, io2->generic.in.sec_desc = io->smb2.in.sec_desc; io2->generic.in.ea_list = &io->smb2.in.eas; io2->generic.in.query_maximal_access = io->smb2.in.query_maximal_access; + io2->generic.in.query_on_disk_id = io->smb2.in.query_on_disk_id; io2->generic.in.private_flags = 0; /* we don't support timewarp yet */ diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index ceee64255f2..48d2712315f 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -407,6 +407,12 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs, return NT_STATUS_OBJECT_NAME_NOT_FOUND; } + if (io->generic.in.query_on_disk_id) { + ZERO_ARRAY(io->generic.out.on_disk_id); + SBVAL(io->generic.out.on_disk_id, 0, name->st.st_ino); + SBVAL(io->generic.out.on_disk_id, 8, name->st.st_dev); + } + /* the open succeeded, keep this handle permanently */ status = ntvfs_handle_set_backend_data(h, pvfs->ntvfs, f); if (!NT_STATUS_IS_OK(status)) { @@ -722,6 +728,12 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs, } } + if (io->generic.in.query_on_disk_id) { + ZERO_ARRAY(io->generic.out.on_disk_id); + SBVAL(io->generic.out.on_disk_id, 0, name->st.st_ino); + SBVAL(io->generic.out.on_disk_id, 8, name->st.st_dev); + } + /* form the lock context used for byte range locking and opendb locking */ status = pvfs_locking_key(name, f->handle, &f->handle->odb_locking_key); @@ -1434,6 +1446,12 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs, NT_STATUS_NOT_OK_RETURN(status); } + if (io->generic.in.query_on_disk_id) { + ZERO_ARRAY(io->generic.out.on_disk_id); + SBVAL(io->generic.out.on_disk_id, 0, name->st.st_ino); + SBVAL(io->generic.out.on_disk_id, 8, name->st.st_dev); + } + status = ntvfs_handle_new(pvfs->ntvfs, req, &h); NT_STATUS_NOT_OK_RETURN(status); diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c index cfef9d18a42..97c4bb570d7 100644 --- a/source4/smb_server/smb/nttrans.c +++ b/source4/smb_server/smb/nttrans.c @@ -134,6 +134,7 @@ static NTSTATUS nttrans_create(struct smbsrv_request *req, io->ntcreatex.in.sec_desc = NULL; io->ntcreatex.in.ea_list = NULL; io->ntcreatex.in.query_maximal_access = false; + io->ntcreatex.in.query_on_disk_id = false; io->ntcreatex.in.private_flags = 0; req_pull_string(&req->in.bufinfo, &io->ntcreatex.in.fname, diff --git a/source4/smb_server/smb/reply.c b/source4/smb_server/smb/reply.c index 7ce5f5dbaa5..8511b8fef6c 100644 --- a/source4/smb_server/smb/reply.c +++ b/source4/smb_server/smb/reply.c @@ -2239,6 +2239,7 @@ void smbsrv_reply_ntcreate_and_X(struct smbsrv_request *req) io->ntcreatex.in.ea_list = NULL; io->ntcreatex.in.sec_desc = NULL; io->ntcreatex.in.query_maximal_access = false; + io->ntcreatex.in.query_on_disk_id = false; io->ntcreatex.in.private_flags = 0; /* we need a neater way to handle this alignment */ diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c index f6460e0ee72..92f148533e1 100644 --- a/source4/smb_server/smb2/fileio.c +++ b/source4/smb_server/smb2/fileio.c @@ -44,6 +44,11 @@ static void smb2srv_create_send(struct ntvfs_request *ntvfs) data_blob_const(data, 8))); } + if (IVAL(io->smb2.out.on_disk_id, 0) != 0) { + SMB2SRV_CHECK(smb2_create_blob_add(req, &io->smb2.out.blobs, + SMB2_CREATE_TAG_QFID, + data_blob_const(io->smb2.out.on_disk_id, 32))); + } SMB2SRV_CHECK(smb2_create_blob_push(req, &blob, io->smb2.out.blobs)); SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x58, true, blob.length)); |