From ec972ebebd5599ee713bad13f64b4924fc74b4b33ca155f038dcf234be468b63 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 2 Nov 2022 11:01:13 +0000 Subject: [PATCH] - bsc#1204811: Fix chage date format string regression * Add shadow-chage-format.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/shadow?expand=0&rev=129 --- shadow-chage-format.patch | 29 +++++++++++++++++++++++++++++ shadow.changes | 6 ++++++ shadow.spec | 5 ++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 shadow-chage-format.patch diff --git a/shadow-chage-format.patch b/shadow-chage-format.patch new file mode 100644 index 0000000..a84796f --- /dev/null +++ b/shadow-chage-format.patch @@ -0,0 +1,29 @@ +From e503fd574b7dbf6b21b1168e20938f0922807916 Mon Sep 17 00:00:00 2001 +From: Xiami <1927254+Xiami2012@users.noreply.github.com> +Date: Wed, 5 Oct 2022 18:11:28 +0800 +Subject: [PATCH] chage: Fix regression in print_date + +Introduced by c6c8130db4319613a91dd07bbb845f6c33c5f79f + +After removing snprintf, the format string should get unescaped once. + +Fixes #564 + +Reporter and patch author: DerMouse (github.com/DerMouse) +--- + src/chage.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/chage.c b/src/chage.c +index 8cf677942..01570d725 100644 +--- a/src/chage.c ++++ b/src/chage.c +@@ -228,7 +228,7 @@ static void print_date (time_t date) + if (NULL == tp) { + (void) printf ("time_t: %lu\n", (unsigned long)date); + } else { +- (void) strftime (buf, sizeof buf, iflg ? "%%Y-%%m-%%d" : "%%b %%d, %%Y", tp); ++ (void) strftime (buf, sizeof buf, iflg ? "%Y-%m-%d" : "%b %d, %Y", tp); + (void) puts (buf); + } + } diff --git a/shadow.changes b/shadow.changes index b5a6732..8cc1ce0 100644 --- a/shadow.changes +++ b/shadow.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 2 10:59:16 UTC 2022 - Michael Vetter + +- bsc#1204811: Fix chage date format string regression + * Add shadow-chage-format.patch + ------------------------------------------------------------------- Mon Oct 24 22:04:41 UTC 2022 - Michael Vetter diff --git a/shadow.spec b/shadow.spec index 2d9761a..0a70058 100644 --- a/shadow.spec +++ b/shadow.spec @@ -59,8 +59,10 @@ Patch7: shadow-login_defs-suse.patch Patch8: useradd-userkeleton.patch # PATCH-FIX-SUSE disable_new_audit_function.patch adam.majer@suse.de -- Disable newer libaudit functionality for older distributions. Patch9: disable_new_audit_function.patch -# PATCH-FIX-UPSTREAM shadow-prefix-overflow.patch mvetter@suse.com -- Fix buffer overflow when using --prefix in useradd +# PATCH-FIX-UPSTREAM shadow-prefix-overflow.patch mvetter@suse.com -- Fix buffer overflow when using --prefix in useradd Patch10: https://github.com/shadow-maint/shadow/commit/eaebea55a495a56317ed85e959b3599f73c6bdf2.patch#/shadow-prefix-overflow.patch +# PATCH-FIX-UPSTREAM shadow-chage-format.patch mvetter@suse.com -- Fix chage format string +Patch11: https://github.com/shadow-maint/shadow/commit/e503fd574b7dbf6b21b1168e20938f0922807916.patch#/shadow-chage-format.patch BuildRequires: audit-devel > 2.3 BuildRequires: autoconf BuildRequires: automake @@ -132,6 +134,7 @@ Development files for libsubid4. %patch9 -p1 %endif %patch10 -p1 +%patch11 -p1 iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8 mv -v doc/HOWTO.utf8 doc/HOWTO