s3:smbd: perform impersonation in smb2_query_directory_fetch_write_time_done()
authorRalph Boehme <slow@samba.org>
Mon, 14 Jan 2019 12:51:23 +0000 (13:51 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 14 Jan 2019 21:30:24 +0000 (22:30 +0100)
This is not strictly required, as we ne never trigger additional VFS
requests via this codepath. But for safety reasons ensure we're running
in the correct impersonation state.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan 14 22:30:24 CET 2019 on sn-devel-144

source3/smbd/smb2_query_directory.c

index 2a426a0dfa3843465df609e0a52d8405d00a8a5a..13fb820ce6cf5f10a7d6623b0d2dd464d9ea9625 100644 (file)
@@ -730,6 +730,13 @@ static void smb2_query_directory_fetch_write_time_done(struct tevent_req *subreq
        struct smbd_smb2_query_directory_state *state = tevent_req_data(
                req, struct smbd_smb2_query_directory_state);
        NTSTATUS status;
+       bool ok;
+
+       /*
+        * Make sure we run as the user again
+        */
+       ok = change_to_user_by_fsp(state->fsp);
+       SMB_ASSERT(ok);
 
        state->async_sharemode_count--;