s3/smbd: add file_id return arg to smbd_dirptr_lanman2_entry
authorRalph Boehme <slow@samba.org>
Thu, 22 Dec 2016 13:53:17 +0000 (14:53 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 18 Apr 2017 20:54:16 +0000 (22:54 +0200)
Not used for now, needed for async write_time updates in
smbd_smb2_query_directory_send().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/globals.h
source3/smbd/smb2_query_directory.c
source3/smbd/trans2.c

index 67d3a892d58e98069c76ee9d0486e45ccd96e196..22e364c71f7d95353a74f385a5f146d6badda7b9 100644 (file)
@@ -206,7 +206,8 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                               int space_remaining,
                               bool *got_exact_match,
                               int *_last_entry_off,
-                              struct ea_list *name_list);
+                              struct ea_list *name_list,
+                              struct file_id *file_id);
 
 NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
                                    const struct smb_filename *smb_fname,
index 2af029bc613d9a86bda156efc0fe3c93b42d66e5..dc716426ef38dee5852b3a3ecf44a6750f0c91c5 100644 (file)
@@ -478,6 +478,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                                               space_remaining,
                                               &got_exact_match,
                                               &last_entry_off,
+                                              NULL,
                                               NULL);
 
                off = (int)PTR_DIFF(pdata, base_data);
index 923fed4ef8e944aa86a459607710b1566c567c3d..e8346ba735a1d3790c176233302dbd981b102bb6 100644 (file)
@@ -2456,7 +2456,8 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                               int space_remaining,
                               bool *got_exact_match,
                               int *_last_entry_off,
-                              struct ea_list *name_list)
+                              struct ea_list *name_list,
+                              struct file_id *file_id)
 {
        const char *p;
        const char *mask = NULL;
@@ -2537,6 +2538,11 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
                DEBUG(1,("Conversion error: illegal character: %s\n",
                         smb_fname_str_dbg(smb_fname)));
        }
+
+       if (file_id != NULL) {
+               *file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
+       }
+
        TALLOC_FREE(fname);
        TALLOC_FREE(smb_fname);
        if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
@@ -2584,7 +2590,7 @@ static NTSTATUS get_lanman2_dir_entry(TALLOC_CTX *ctx,
                                         ppdata, base_data, end_data,
                                         space_remaining,
                                         got_exact_match,
-                                        last_entry_off, name_list);
+                                        last_entry_off, name_list, NULL);
 }
 
 /****************************************************************************