]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: let canonicalize_snapshot_path() fill in struct smb_filename.twrp
authorRalph Boehme <slow@samba.org>
Thu, 30 Apr 2020 13:17:11 +0000 (15:17 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 5 May 2020 19:18:40 +0000 (19:18 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/filename.c

index c80b0fde797f51900624e036fbbd33e2e950ef18..b038287aa228239c2c414e728a19519101997f43 100644 (file)
@@ -370,6 +370,7 @@ static NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname,
        char *startp = strchr_m(smb_fname->base_name, '@');
        char *endp = NULL;
        struct tm tm;
+       time_t t;
        NTSTATUS status;
 
        if (twrp != NULL) {
@@ -393,6 +394,7 @@ static NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname,
                TALLOC_FREE(smb_fname->base_name);
                smb_fname->base_name = twrp_name;
 
+               unix_to_nt_time(&smb_fname->twrp, *twrp);
                return NT_STATUS_OK;
        }
 
@@ -431,6 +433,10 @@ static NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname,
                return status;
        }
 
+       tm.tm_isdst = -1;
+       t = timegm(&tm);
+       unix_to_nt_time(&smb_fname->twrp, t);
+
        return NT_STATUS_OK;
 }