chpasswd fix coredump with s parameter

Signed-off-by: beta <beta@yfqm.date>
(cherry picked from commit dd0c07f504b803d557353d4252b4ce550ddd7d1a)
This commit is contained in:
beta 2024-12-11 11:54:40 +08:00 committed by openeuler-sync-bot
parent e4ff2d91b3
commit c657843ace
2 changed files with 6 additions and 3 deletions

View File

@ -496,8 +496,8 @@ index 1a1a5d5..a2b6e9e 100644
#endif /* USE_YESCRYPT */
- if (bad_s != 0) {
+#if defined(USE_SM3_CRYPT)
+ if (( (0 == strcmp (crypt_method, "SM3"))
+ && (0 == getlong(optarg, &sm3_rounds)))) {
+ if (IS_CRYPT_METHOD("SM3")
+ && (0 == getlong(optarg, &sm3_rounds))) {
+ bad_s = 1;
+ }
+#endif /* USE_SM3_CRYPT */

View File

@ -1,6 +1,6 @@
Name: shadow
Version: 4.14.3
Release: 3
Release: 4
Epoch: 2
License: BSD and GPLv2+
Summary: Tools for managing accounts and shadow password files
@ -191,6 +191,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.{la,a}
%{_mandir}/*/*
%changelog
* Wed Dec 11 2024 beta <beta@yfqm.date> - 2:4.14.3-4
- chpasswd fix coredump with s parameter
* Wed Oct 9 2024 zhangxingrong <zhangxingrong@uniontech.com> - 2:4.14.3-3
- lib/idmapping.c: Use long constants in prctl(2)
- man/lastlog: remove wrong use of keyword term