From: Christof Schmitt Date: Tue, 14 Apr 2020 23:40:55 +0000 (-0700) Subject: smbclient: Also allow four digit years in utimes command X-Git-Tag: ldb-2.2.0~919 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3ef646cb74ff903db3465f84752a7fc43df241c;p=thirdparty%2Fsamba.git smbclient: Also allow four digit years in utimes command Signed-off-by: Christof Schmitt Reviewed-by: Volker Lendecke --- diff --git a/source3/client/client.c b/source3/client/client.c index b19d4752691..87b27062d15 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -5237,13 +5237,17 @@ static int cmd_utimes(void) 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 */ if (ret == NULL || *ret != 0) { d_printf("Invalid date format: %s\n", s); d_printf("utimes " " \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; }