From c9a71e07ad1b14f5dcd96ecce8e92f67a92b041f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Sep 2022 15:15:38 -0700 Subject: [PATCH] s3: smbtorture: In run_smb1_dfs_paths() ensure we're actually reading and testing crtimes from the filesystem. Ensures crtime of the root of the share and a newly created file crtime are different. Should help avoid mistakes like the error fixed by the previous commit. Signed-off-by: Jeremy Allison Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Mon Sep 12 16:21:23 UTC 2022 on sn-devel-184 --- source3/torture/test_smb1_dfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source3/torture/test_smb1_dfs.c b/source3/torture/test_smb1_dfs.c index d8b7552935f..1acea318e37 100644 --- a/source3/torture/test_smb1_dfs.c +++ b/source3/torture/test_smb1_dfs.c @@ -1587,6 +1587,7 @@ bool run_smb1_dfs_paths(int dummy) bool crtime_matched = false; bool retval = false; bool ok = false; + bool equal = false; unsigned int i; uint16_t fnum = (uint16_t)-1; @@ -1846,6 +1847,21 @@ bool run_smb1_dfs_paths(int dummy) goto err; } + /* + * This crtime must be different from the root_crtime. + * This checks we're actually correctly reading crtimes + * from the filesystem. + */ + equal = (timespec_compare(&test_crtime, &root_crtime) == 0); + if (equal) { + printf("%s:%d Error. crtime of %s must differ from " + "root_crtime\n", + __FILE__, + __LINE__, + "BAD\\BAD\\file"); + goto err; + } + /* * Test different SMB1 renames * and hard links. -- 2.47.3