]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: return correct timestamps for quota fake file
authorRalph Boehme <slow@samba.org>
Mon, 7 Jun 2021 17:02:56 +0000 (19:02 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 9 Jun 2021 20:38:02 +0000 (20:38 +0000)
Prior to 572d4e3a56eef00e29f93482daa21647af7310d0 it was sufficient to
initialize struct timespec to zero to return NTTIME 0 (ie not set) over
SMB.

This fixes the same problem from bug 14714 where the timestamps in an SMB2 CLOSE
response.

Windows of course does return *some* timestamps, but as it's neither documented
nor was I able to figure out where they would be coming from, as well as the
Windows client apparently doesn't care, I didn't bother with implementing some
sophisticated heuristic to return some timestamps.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14731

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): Wed Jun  9 20:38:02 UTC 2021 on sn-devel-184

selftest/knownfail.d/samba3.smb2.create [deleted file]
source3/smbd/filename.c

diff --git a/selftest/knownfail.d/samba3.smb2.create b/selftest/knownfail.d/samba3.smb2.create
deleted file mode 100644 (file)
index e1ca027..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba3.smb2.create.quota-fake-file\(nt4_dc\)
-^samba3.smb2.create.quota-fake-file\(ad_dc\)
index 44a58a20c1ff737803379ebfd848bf01236f9f87..11022dca7038f6495beefb6de07be8d8f7fc8ce3 100644 (file)
@@ -1972,6 +1972,11 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx,
                        return NT_STATUS_NO_MEMORY;
                }
                smb_fname->st = (SMB_STRUCT_STAT) { .st_ex_nlink = 1 };
+               smb_fname->st.st_ex_btime = (struct timespec){0, SAMBA_UTIME_OMIT};
+               smb_fname->st.st_ex_atime = (struct timespec){0, SAMBA_UTIME_OMIT};
+               smb_fname->st.st_ex_mtime = (struct timespec){0, SAMBA_UTIME_OMIT};
+               smb_fname->st.st_ex_ctime = (struct timespec){0, SAMBA_UTIME_OMIT};
+
                *_smb_fname = smb_fname;
                return NT_STATUS_OK;
        }