diff --git a/backport-cracklib-2.9.6-lookup.patch b/backport-cracklib-2.9.6-lookup.patch deleted file mode 100644 index 52ce8577a171879e324257b4ff6b4f066455ba00..0000000000000000000000000000000000000000 --- a/backport-cracklib-2.9.6-lookup.patch +++ /dev/null @@ -1,60 +0,0 @@ -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-2.9.11.tar.gz b/cracklib-2.9.11.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..99ab397bafde71dfefd6bc84ecc9404ee29c6bf1 Binary files /dev/null and b/cracklib-2.9.11.tar.gz differ diff --git a/cracklib-2.9.8.tar.gz b/cracklib-2.9.8.tar.gz deleted file mode 100644 index f97200c5d07cf6efc51019bee73f2212e9a4e89a..0000000000000000000000000000000000000000 Binary files a/cracklib-2.9.8.tar.gz and /dev/null differ diff --git a/cracklib-words-2.9.8.gz b/cracklib-words-2.9.11.gz similarity index 99% rename from cracklib-words-2.9.8.gz rename to cracklib-words-2.9.11.gz index edef8b20ed5b97dbe507ef0f22dcc33249c5d169..4be0a0114d798000ebda58efd94ac3f9bfa9b6f4 100644 Binary files a/cracklib-words-2.9.8.gz and b/cracklib-words-2.9.11.gz differ diff --git a/cracklib.spec b/cracklib.spec index e776736a3a5fb6f59b4ee1178a6090f1bae27545..5fc4882c76b3f2048df08199814a169dc7cc77f0 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -1,27 +1,21 @@ -%bcond_without python3 - %define dictdir %{_datadir}/cracklib %define dictpath %{dictdir}/pw_dict Name: cracklib -Version: 2.9.8 -Release: 2 +Version: 2.9.11 +Release: 1 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 + Patch0: fix-problem-of-error-message-about-simplistic-passwo.patch -Patch1: backport-cracklib-2.9.6-lookup.patch -# After fix-problem-of-error-message-about-simplistic-passwo.patch -Patch2: fix-error-length-about-simplistic-password.patch -Patch3: fix-truncating-dict-file-without-input-data.patch +Patch1: fix-error-length-about-simplistic-password.patch BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel -%if %{with python3} BuildRequires: python3-devel -%endif Conflicts: cracklib-dicts < 2.8 Requires: gzip @@ -50,7 +44,6 @@ for compiling applications which use cracklib. %package_help -%if %{with python3} %package -n python3-cracklib Summary: Python 3 bindings for applications which use cracklib Requires: %{name} = %{version}-%{release} @@ -58,7 +51,6 @@ Requires: %{name} = %{version}-%{release} %description -n python3-cracklib The python3-cracklib package contains a module which permits applications written in the Python 3 programming language to use cracklib. -%endif %prep %autosetup -n %{name}-%{version} -p1 @@ -71,7 +63,6 @@ done chmod +x util/cracklib-format %build -%if %{with python3} sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in py3include=`python3-config --includes | awk -F' ' '{print $1;}'` export PYTHON=%{__python3} @@ -86,13 +77,10 @@ py_version="%{python3_version}$abiflags" --with-default-dict=%{dictpath} make -C po update-gmo make -%endif %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -%if %{with python3} make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}' -%endif ./util/cracklib-format cracklib-dicts/* | \ ./util/cracklib-packer $RPM_BUILD_ROOT/%{dictpath} @@ -145,15 +133,18 @@ make test %files help %doc README README-WORDS NEWS +%{_mandir}/man3/* +%{_mandir}/man8/* -%if %{with python3} %files -n python3-cracklib %{_libdir}/python3*/site-packages/_cracklib*.so %{_libdir}/python3*/site-packages/*.py* %{_libdir}/python3*/site-packages/__pycache__/* -%endif %changelog +* Fri Jul 14 2023 yixiangzhike - 2.9.11-1 +- update to 2.9.11 + * Wed Apr 26 2023 yixiangzhike - 2.9.8-2 - add version for the symbol cracklib-dicts diff --git a/fix-truncating-dict-file-without-input-data.patch b/fix-truncating-dict-file-without-input-data.patch deleted file mode 100644 index 797cfa12d4e2bb33988c2390ec9fd4b4443916eb..0000000000000000000000000000000000000000 --- a/fix-truncating-dict-file-without-input-data.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 17970a5f2092f699ffb2f22a7fd6c40456907987 Mon Sep 17 00:00:00 2001 -From: yixiangzhike -Date: Sat, 13 Aug 2022 12:01:45 +0800 -Subject: [PATCH] Fix truncating dict file without input data - - -diff --git a/util/packer.c b/util/packer.c -index e3f9500..4867641 100644 ---- a/util/packer.c -+++ b/util/packer.c -@@ -22,6 +22,7 @@ main(argc, argv) - PWDICT *pwp; - char buffer[STRINGSIZE], prev[STRINGSIZE]; - char *file; -+ char opened = 0; - - if (argc <= 1) - { -@@ -39,12 +40,6 @@ main(argc, argv) - return (-1); - } - -- if (!(pwp = PWOpen(file, "w"))) -- { -- perror(file); -- return (-1); -- } -- - wrote = 0; - prev[0] = '\0'; - -@@ -62,6 +57,16 @@ main(argc, argv) - continue; - } - -+ if (!opened) -+ { -+ if (!(pwp = PWOpen(file, "w"))) -+ { -+ perror(file); -+ return (-1); -+ } -+ opened = 1; -+ } -+ - /* - * If this happens, strcmp() in FindPW() in packlib.c will be unhappy. - */ -@@ -79,7 +84,8 @@ main(argc, argv) - wrote++; - } - -- PWClose(pwp); -+ if (opened) -+ PWClose(pwp); - - printf("%lu %lu\n", readed, wrote); - --- -2.33.0 -