smbd: explain that/why we use the raw tevent_context for update_write_time_handler()
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 09:54:41 +0000 (10:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Jun 2018 06:59:19 +0000 (08:59 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/fileio.c

index cde6a057ccdafc65f1148a4a43976330421c6a64..1fe806e058d28db895501bd67ba751c6902d9755 100644 (file)
@@ -232,9 +232,17 @@ void trigger_write_time_update(struct files_struct *fsp)
        DEBUG(5, ("Update write time %d usec later on %s\n",
                  delay, fsp_str_dbg(fsp)));
 
-       /* trigger the update 2 seconds later */
+       /*
+        * trigger the update 2 seconds later
+        *
+        * Note that update_write_time_handler()
+        * => fsp_flush_write_time_update()
+        * won't do any SMB_VFS calls and don't
+        * need impersonation. So we use the
+        * raw event context for this.
+        */
        fsp->update_write_time_event =
-               tevent_add_timer(fsp->conn->sconn->ev_ctx, NULL,
+               tevent_add_timer(fsp->conn->sconn->raw_ev_ctx, NULL,
                                 timeval_current_ofs_usec(delay),
                                 update_write_time_handler, fsp);
 }