The branch, master has been updated
       via  98ea4a2 pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID
      from  23b4fb6 s3-libnet: Add missing format element

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 98ea4a2219c4ff1c1a8307f64a7588845be7af6f
Author: ouyang.xu <[email protected]>
Date:   Mon Jul 11 18:12:52 2016 +0800

    pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID
    
    Signed-off-by: kkhaike <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    Reviewed-by: Uri Simchoni <[email protected]>
    
    Autobuild-User(master): Uri Simchoni <[email protected]>
    Autobuild-Date(master): Fri Aug 19 09:35:15 CEST 2016 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source4/libcli/raw/interfaces.h  |  4 +++-
 source4/ntvfs/ntvfs_generic.c    |  3 +++
 source4/ntvfs/posix/pvfs_open.c  | 18 ++++++++++++++++++
 source4/smb_server/smb/nttrans.c |  1 +
 source4/smb_server/smb/reply.c   |  1 +
 source4/smb_server/smb2/fileio.c |  5 +++++
 6 files changed, 31 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h
index 7e8258e..732ba15 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 4edc31c..fe68b41 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 ceee642..48d2712 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 cfef9d1..97c4bb5 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 7ce5f5d..8511b8f 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 f6460e0..92f1485 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));


-- 
Samba Shared Repository

Reply via email to