s3:smbd: write times should be set on the base file instead of the stream name
authorStefan Metzmacher <metze@samba.org>
Mon, 1 Dec 2008 21:44:40 +0000 (13:44 -0800)
committerKarolin Seeger <kseeger@samba.org>
Thu, 11 Dec 2008 09:27:11 +0000 (10:27 +0100)
metze
(cherry picked from commit 47b270c3f83a86c3a6f4c3ae92a04c308ded9290)

source/smbd/trans2.c

index 4ad94b58c9854d7c3eb0ab836703ea76fa367e1d..d4751657c334676f2736c33d34dafb6e709763a6 100644 (file)
@@ -4951,7 +4951,11 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
                          time_to_asc(convert_timespec_to_time_t(ts[1])) ));
 
                if (fsp != NULL) {
-                       set_sticky_write_time_fsp(fsp, ts[1]);
+                       if (fsp->base_fsp) {
+                               set_sticky_write_time_fsp(fsp->base_fsp, ts[1]);
+                       } else {
+                               set_sticky_write_time_fsp(fsp, ts[1]);
+                       }
                } else {
                        set_sticky_write_time_path(conn, fname,
                                            vfs_file_id_from_sbuf(conn, psbuf),
@@ -4961,6 +4965,10 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
 
        DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n"));
 
+       if (fsp && fsp->base_fsp) {
+               fname = fsp->base_fsp->fsp_name;
+       }
+
        if(file_ntimes(conn, fname, ts)!=0) {
                return map_nt_error_from_unix(errno);
        }