forked from pool/shadow
ec972ebebd
* Add shadow-chage-format.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/shadow?expand=0&rev=129
30 lines
927 B
Diff
30 lines
927 B
Diff
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);
|
|
}
|
|
}
|