!14 【Mainline】Fix lookup for word in FindPW
From: @yixiangzhike Reviewed-by: @zhujianwei001 Signed-off-by: @zhujianwei001
This commit is contained in:
commit
e0059e6f68
60
backport-cracklib-2.9.6-lookup.patch
Normal file
60
backport-cracklib-2.9.6-lookup.patch
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
diff -up cracklib-2.9.6/lib/packlib.c.lookup cracklib-2.9.6/lib/packlib.c
|
||||||
|
--- cracklib-2.9.6/lib/packlib.c.lookup 2018-10-10 14:19:06.988958835 +0200
|
||||||
|
+++ cracklib-2.9.6/lib/packlib.c 2018-11-26 16:04:34.648256614 +0100
|
||||||
|
@@ -585,12 +585,11 @@ fprintf(stderr, "look for (%s)\n", strin
|
||||||
|
fprintf(stderr, "---- %lu, %lu ----\n", lwm, hwm);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
- middle = lwm + ((hwm - lwm + 1) / 2);
|
||||||
|
-
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
+ middle = lwm + ((hwm - lwm + 1) / 2);
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
fprintf(stderr, "lwm = %lu, middle = %lu, hwm = %lu\n", lwm, middle, hwm);
|
||||||
|
@@ -617,24 +616,28 @@ fprintf(stderr, "look for (%s)\n", strin
|
||||||
|
return(middle);
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (middle == hwm)
|
||||||
|
- {
|
||||||
|
-#if DEBUG
|
||||||
|
- fprintf(stderr, "at terminal subdivision, stopping search\n");
|
||||||
|
-#endif
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
if (cmp < 0)
|
||||||
|
{
|
||||||
|
- hwm = middle;
|
||||||
|
- middle = lwm + ((hwm - lwm ) / 2);
|
||||||
|
- }
|
||||||
|
+ if (middle == lwm)
|
||||||
|
+ {
|
||||||
|
+#if DEBUG
|
||||||
|
+ fprintf(stderr, "at terminal subdivision from right, stopping search\n");
|
||||||
|
+#endif
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ hwm = middle - 1;
|
||||||
|
+ }
|
||||||
|
else if (cmp > 0)
|
||||||
|
{
|
||||||
|
- lwm = middle;
|
||||||
|
- middle = lwm + ((hwm - lwm + 1) / 2);
|
||||||
|
- }
|
||||||
|
+ if (middle == hwm)
|
||||||
|
+ {
|
||||||
|
+#if DEBUG
|
||||||
|
+ fprintf(stderr, "at terminal subdivision from left, stopping search\n");
|
||||||
|
+#endif
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ lwm = middle + 1;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
return (PW_WORDS(pwp));
|
||||||
@ -5,14 +5,15 @@
|
|||||||
|
|
||||||
Name: cracklib
|
Name: cracklib
|
||||||
Version: 2.9.7
|
Version: 2.9.7
|
||||||
Release: 6
|
Release: 7
|
||||||
Summary: A password-checking library
|
Summary: A password-checking library
|
||||||
|
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: http://sourceforge.net/projects/cracklib/
|
URL: http://sourceforge.net/projects/cracklib/
|
||||||
Source0: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-%{version}.tar.gz
|
Source0: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-%{version}.tar.gz
|
||||||
Source1: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-words-%{version}.gz
|
Source1: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-words-%{version}.gz
|
||||||
Patch9000: fix-problem-of-error-message-about-simplistic-passwo.patch
|
Patch0: fix-problem-of-error-message-about-simplistic-passwo.patch
|
||||||
|
Patch1: backport-cracklib-2.9.6-lookup.patch
|
||||||
|
|
||||||
BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel
|
BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel
|
||||||
%if %{with python3}
|
%if %{with python3}
|
||||||
@ -150,6 +151,9 @@ make test
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 6 2021 yixiangzhike <yixiangzhike007@163.com> - 2.9.7-7
|
||||||
|
- fix lookup for word in FindPW()
|
||||||
|
|
||||||
* Mon May 24 2021 yixiangzhike <zhangxingliang3@huawei.com> - 2.9.7-6
|
* Mon May 24 2021 yixiangzhike <zhangxingliang3@huawei.com> - 2.9.7-6
|
||||||
- add %%config(noreplace) for pw_dict
|
- add %%config(noreplace) for pw_dict
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user