!36 【Mainline】Update to 2.9.11

From: @yixiangzhike 
Reviewed-by: @houmingyong 
Signed-off-by: @houmingyong
This commit is contained in:
openeuler-ci-bot 2023-07-14 06:38:35 +00:00 committed by Gitee
commit 455f917dd1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 9 additions and 139 deletions

View File

@ -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));

BIN
cracklib-2.9.11.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -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 <yixiangzhike007@163.com> - 2.9.11-1
- update to 2.9.11
* Wed Apr 26 2023 yixiangzhike <yixiangzhike007@163.com> - 2.9.8-2
- add version for the symbol cracklib-dicts

View File

@ -1,61 +0,0 @@
From 17970a5f2092f699ffb2f22a7fd6c40456907987 Mon Sep 17 00:00:00 2001
From: yixiangzhike <yixiangzhike007@163.com>
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