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 <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Sep 12 16:21:23 UTC 2022 on sn-devel-184
bool crtime_matched = false;
bool retval = false;
bool ok = false;
+ bool equal = false;
unsigned int i;
uint16_t fnum = (uint16_t)-1;
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.