[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Mar 1 20:56:01 UTC 2023


The branch, master has been updated
       via  682c77be74b s4:torture:basic: use milliseconds granularity in delayed_write_update7
       via  cb9df8181e3 lib: add NTTIME_[U|m]SEC macros
       via  122d645868a s4:torture:basic: fix SET_INFO_* macros in delayed_write_update*
      from  460fd441d7f s3:winbind: Improve warning message if we are out of autorid ranges

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 682c77be74b3f996f1278648a54b33cdbb9df4de
Author: Amir Goldstein <amir at ctera.com>
Date:   Thu Feb 9 11:39:21 2023 +0200

    s4:torture:basic: use milliseconds granularity in delayed_write_update7
    
    The test sets an mtime with non zero nsec and verifies that
    the timestamp of pre-close matches the timestamp after close-open.
    
    This is a regression test for
    https://bugzilla.samba.org/show_bug.cgi?id=6529
    
    The bug speaks of loosing the milliseconds part of the timestamp,
    but the test uses a value of 103*100ns for the sub-second part.
    
    Meaning that if the backing filesystem has only milliseconds
    granularity, the test practically checks that a value of
    0 milliseconds is preserved, which will not have actually
    caught the bug.
    
    Also, with the default 'smbd getinfo ask sharemode = yes'
    the test will fail if the filesystem truncates the sub-second part
    to milliseconds granularity.
    
    Use a non-zero milliseconds value with zero microseconds in the test
    to support backing filesystems with milliseconds granularity.
    
    Signed-off-by: Amir Goldstein <amir at ctera.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Mar  1 20:55:47 UTC 2023 on atb-devel-224

commit cb9df8181e32f13f4004183d21b2b00a0149dfad
Author: Amir Goldstein <amir at ctera.com>
Date:   Tue Feb 28 12:53:03 2023 +0100

    lib: add NTTIME_[U|m]SEC macros
    
    Signed-off-by: Amir Goldstein <amir at ctera.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 122d645868ac5a046fb1cbd84e8fc3847318fa2c
Author: Amir Goldstein <amir at ctera.com>
Date:   Thu Feb 9 11:39:21 2023 +0200

    s4:torture:basic: fix SET_INFO_* macros in delayed_write_update*
    
    The macros were ignoring the finfo argument.
    
    Signed-off-by: Amir Goldstein <amir at ctera.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/util/time.h                    |  3 +++
 source4/torture/basic/delaywrite.c | 11 ++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/time.h b/lib/util/time.h
index 8b61e41ae94..4870c84de62 100644
--- a/lib/util/time.h
+++ b/lib/util/time.h
@@ -72,6 +72,9 @@
 /* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30, 4 byte aligned */
 typedef uint64_t NTTIME;
 
+#define NTTIME_USEC (10UL)
+#define NTTIME_MSEC (1000UL * NTTIME_USEC)
+
 /**
  External access to time_t_min and time_t_max.
 **/
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c
index 620870120bd..e36481d4a49 100644
--- a/source4/torture/basic/delaywrite.c
+++ b/source4/torture/basic/delaywrite.c
@@ -1361,7 +1361,7 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
 	sfinfo.basic_info.in.access_time = 0; \
 	unix_to_nt_time(&sfinfo.basic_info.in.write_time, (wrtime)); \
 	sfinfo.basic_info.in.change_time = 0; \
-	sfinfo.basic_info.in.attrib = finfo1.basic_info.out.attrib; \
+	sfinfo.basic_info.in.attrib = finfo.basic_info.out.attrib; \
 	_status = smb_raw_setfileinfo(tree, &sfinfo); \
 	if (!NT_STATUS_IS_OK(_status)) { \
 		torture_result(tctx, TORTURE_FAIL, __location__": setfileinfo failed: %s", \
@@ -1383,7 +1383,7 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
 	unix_to_nt_time(&sfinfo.basic_info.in.write_time, (wrtime)); \
 	sfinfo.basic_info.in.write_time += (ns); \
 	sfinfo.basic_info.in.change_time = 0; \
-	sfinfo.basic_info.in.attrib = finfo1.basic_info.out.attrib; \
+	sfinfo.basic_info.in.attrib = finfo.basic_info.out.attrib; \
 	_status = smb_raw_setfileinfo(tree, &sfinfo); \
 	if (!NT_STATUS_IS_OK(_status)) { \
 		torture_result(tctx, TORTURE_FAIL, __location__": setfileinfo failed: %s", \
@@ -2902,9 +2902,10 @@ static bool test_delayed_write_update7(struct torture_context *tctx, struct smbc
 	status = smb_raw_fileinfo(cli->tree, tctx, &finfo1);
 
 	torture_assert_ntstatus_ok(tctx, status, "fileinfo failed");
-	
-	/* Set the pending write time to a value with ns. */
-	SET_INFO_FILE_NS(finfo, time(NULL) + 86400, 103, cli->tree, fnum1);
+
+	/* Set the pending write time to a value with non zero msec. */
+	SET_INFO_FILE_NS(finfo1, time(NULL) + 86400, 103 * NTTIME_MSEC,
+			 cli->tree, fnum1);
 
 	/* Get the current pending write time by fnum. */
 	status = smb_raw_fileinfo(cli->tree, tctx, &finfo2);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list