diff --git a/backport-cracklib-2.9.6-lookup.patch b/backport-cracklib-2.9.6-lookup.patch new file mode 100644 index 0000000000000000000000000000000000000000..52ce8577a171879e324257b4ff6b4f066455ba00 --- /dev/null +++ b/backport-cracklib-2.9.6-lookup.patch @@ -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)); diff --git a/cracklib.spec b/cracklib.spec index a07218b24a3b7e11f99580da1cce7974f48069d9..e8da7471b26912671118ca0db249d9c764161fe5 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -5,14 +5,15 @@ Name: cracklib Version: 2.9.7 -Release: 7 +Release: 8 Summary: A password-checking library License: LGPLv2+ URL: http://sourceforge.net/projects/cracklib/ 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 -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, chrpath %if %{with python3} @@ -164,6 +165,9 @@ make test %endif %changelog +* Mon Dec 6 2021 yixiangzhike - 2.9.7-8 +- fix lookup for word in FindPW() + * Mon Sep 6 2021 yixiangzhike - 2.9.7-7 - delete rpath and runpath from exec files and libraries