diff --git a/cracklib.spec b/cracklib.spec index cf71e4e0f4397f9490aeb662e7c972852cc28b55..8bf872d3cae96fa0efd841b77d130275455d9698 100644 --- a/cracklib.spec +++ b/cracklib.spec @@ -5,7 +5,7 @@ Name: cracklib Version: 2.9.7 -Release: 9 +Release: 10 Summary: A password-checking library License: LGPLv2+ @@ -14,6 +14,9 @@ Source0: https://github.com/cracklib/cracklib/releases/download/v%{version}/crac 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 BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel, chrpath %if %{with python3} @@ -161,6 +164,10 @@ make test %endif %changelog +* Sat Aug 13 2022 yixiangzhike - 2.9.7-10 +- fix issue of truncating dict file without input data +- fix error length about simplistic password + * Mon Apr 11 2022 yixiangzhike - 2.9.7-9 - delete unused ld config file for python module _cracklib.so diff --git a/fix-error-length-about-simplistic-password.patch b/fix-error-length-about-simplistic-password.patch new file mode 100644 index 0000000000000000000000000000000000000000..fc97889a5964afd7a332d828520e50326e079e43 --- /dev/null +++ b/fix-error-length-about-simplistic-password.patch @@ -0,0 +1,25 @@ +From 7d4b42752a11b12088baad881a6e2cac3da638e7 Mon Sep 17 00:00:00 2001 +From: yixiangzhike +Date: Sat, 13 Aug 2022 13:04:17 +0800 +Subject: [PATCH] fix error length about simplistic password + +--- + util/cracklib-format | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/util/cracklib-format b/util/cracklib-format +index 360d109..2c1f61f 100755 +--- a/util/cracklib-format ++++ b/util/cracklib-format +@@ -6,7 +6,7 @@ + LC_ALL=C + export LC_ALL + gzip -cdf "$@" | +- grep -a -E -v '^.{30,}$' | ++ grep -a -E -v '^.{32,}$' | + tr '[:upper:]' '[:lower:]' | + sed s/[[:space:]]//g | + sort -u +-- +2.33.0 + diff --git a/fix-truncating-dict-file-without-input-data.patch b/fix-truncating-dict-file-without-input-data.patch new file mode 100644 index 0000000000000000000000000000000000000000..797cfa12d4e2bb33988c2390ec9fd4b4443916eb --- /dev/null +++ b/fix-truncating-dict-file-without-input-data.patch @@ -0,0 +1,61 @@ +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 +