[SCM] Samba Shared Repository - branch master updated

Christof Schmitt cs at samba.org
Thu Apr 16 19:07:04 UTC 2020


The branch, master has been updated
       via  5c73a2b3c1f docs: Update smbclient manpage that four digit years are also allowed
       via  2d5ffed7797 test_smbclient_s3: Test four-digit year in smbclient utimes
       via  e3ef646cb74 smbclient: Also allow four digit years in utimes command
       via  ab629af7b15 smbclient: Remove one level of indentation for the utimes command
      from  34f8ab774d1 s3/librpc/crypto: Fix double free with unresolved credential cache

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


- Log -----------------------------------------------------------------
commit 5c73a2b3c1f802e5ede449b505a0fbc2e775efef
Author: Christof Schmitt <cs at samba.org>
Date:   Wed Apr 15 14:56:03 2020 -0700

    docs: Update smbclient manpage that four digit years are also allowed
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Christof Schmitt <cs at samba.org>
    Autobuild-Date(master): Thu Apr 16 19:06:32 UTC 2020 on sn-devel-184

commit 2d5ffed7797feec93e16e4fc1e1c95d1c6f55e12
Author: Christof Schmitt <cs at samba.org>
Date:   Wed Apr 15 14:53:08 2020 -0700

    test_smbclient_s3: Test four-digit year in smbclient utimes
    
    Modify the test to also set the create_time, and specify the year with
    using four digits to test the new codepath.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit e3ef646cb74ff903db3465f84752a7fc43df241c
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Apr 14 16:40:55 2020 -0700

    smbclient: Also allow four digit years in utimes command
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit ab629af7b1571e6bb819119141a6e6e5d9453d59
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Apr 14 16:38:03 2020 -0700

    smbclient: Remove one level of indentation for the utimes command
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 docs-xml/manpages/smbclient.1.xml         |  2 +-
 source3/client/client.c                   | 12 ++++++++----
 source3/script/tests/test_smbclient_s3.sh | 23 ++++++++++++++++++-----
 3 files changed, 27 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/smbclient.1.xml b/docs-xml/manpages/smbclient.1.xml
index 0f556a874db..64a3dc285bd 100644
--- a/docs-xml/manpages/smbclient.1.xml
+++ b/docs-xml/manpages/smbclient.1.xml
@@ -1187,7 +1187,7 @@
 		<term>utimes <filename> <create time> <access time> <write time> <
 		change time></term>
 		<listitem><para>Changes the timestamps on a file by name.
-		Times should be specified in the format YY:MM:DD-HH:MM:SS or -1 for no change.
+		Times should be specified in the format [YY]YY:MM:DD-HH:MM:SS or -1 for no change.
 		</para></listitem>
 		</varlistentry>
 
diff --git a/source3/client/client.c b/source3/client/client.c
index f2cb3c8a337..87b27062d15 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -5233,8 +5233,12 @@ static int cmd_utimes(void)
 			times[time_count] = make_omit_timespec();
 			time_count++;
 			continue;
-		} else {
-			ret = strptime(s, "%y:%m:%d-%H:%M:%S", &tm);
+		}
+
+		ret = strptime(s, "%y:%m:%d-%H:%M:%S", &tm);
+
+		if (ret == NULL) {
+			ret = strptime(s, "%Y:%m:%d-%H:%M:%S", &tm);
 		}
 
 		/* We could not match all the chars, so print error */
@@ -5242,8 +5246,8 @@ static int cmd_utimes(void)
 			d_printf("Invalid date format: %s\n", s);
 			d_printf("utimes <filename> <create-time> "
 				"<access-time> <write-time> <change-time>\n");
-			d_printf("Dates should be in YY:MM:DD-HH:MM:SS format "
-				"or -1 for no change\n");
+			d_printf("Dates should be in [YY]YY:MM:DD-HH:MM:SS "
+				 "format or -1 for no change\n");
 			err = 1;
 			goto out;
 		}
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 5df8a7cb550..3ea55f54107 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -1469,7 +1469,7 @@ test_utimes()
 del utimes_test
 put ${SMBCLIENT} utimes_test
 allinfo utimes_test
-utimes utimes_test -1 17:01:01-05:10:20 -1 -1
+utimes utimes_test 2016:02:04-06:19:20 17:01:01-05:10:20 -1 -1
 allinfo utimes_test
 del utimes_test
 quit
@@ -1497,15 +1497,16 @@ EOF
 	return
     fi
 
-    # Now, we should have 2 identical create_time, write_time, change_time
-    # values, but one access_time of Jan  1 05:10:20 AM.
+    # Now, we should have 2 identical write_time and change_time
+    # values, but one access_time of Jan  1 05:10:20 AM,
+    # and one create_time of Feb 04 06:19:20 AM 2016
     out_sorted=`echo "$out" | sort | uniq`
     num_create=`echo "$out_sorted" | grep -c 'create_time:'`
     num_access=`echo "$out_sorted" | grep -c 'access_time:'`
     num_write=`echo "$out_sorted" | grep -c 'write_time:'`
     num_change=`echo "$out_sorted" | grep -c 'change_time:'`
-    if [ "$num_create" != "1" ]; then
-        echo "failed - should only get one create_time $out"
+    if [ "$num_create" != "2" ]; then
+        echo "failed - should get two create_time $out"
         false
         return
     fi
@@ -1536,6 +1537,18 @@ EOF
        false
        return
     fi
+
+    # This could be: Thu Feb  4 06:19:20 AM 2016
+    # or           : Thu Feb  4 06:19:20 2016 CET
+    echo "$out" | grep 'create_time:.*Thu Feb.*4 06:19:20 .*2016.*'
+    ret=$?
+    if [ $ret -ne 0 ] ; then
+       echo "$out"
+       echo
+       echo "failed - should get access_time:    Thu Feb  4 06:19:20 [AM] 2016"
+       false
+       return
+    fi
 }
 
 # Test smbclient renames with pathnames containing '..'


-- 
Samba Shared Repository



More information about the samba-cvs mailing list