Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
1e70638ab3
!34 [sync] PR-32: 【openEuler-22.03-LTS-SP1】Add version for the symbol cracklib-dicts
From: @openeuler-sync-bot 
Reviewed-by: @houmingyong 
Signed-off-by: @houmingyong
2023-04-26 09:13:34 +00:00
yixiangzhike
175a57a911 Add version for the symbol cracklib-dicts
(cherry picked from commit db65ffcd751a291af3b581e3f9a4ff3ba6143191)
2023-04-26 16:55:36 +08:00
openeuler-ci-bot
da67e58c93
!30 【openEuler-22.03-LTS-Next】update to 2.9.8
From: @yixiangzhike 
Reviewed-by: @houmingyong 
Signed-off-by: @houmingyong
2022-10-24 02:39:39 +00:00
yixiangzhike
9b23c71dc8 update to 2.9.8
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
2022-10-21 14:49:35 +08:00
openeuler-ci-bot
e5872c5875
!25 【openEuler-22.03-LTS-Next】Fix issue of error length and truncate dict file
From: @yixiangzhike 
Reviewed-by: @houmingyong 
Signed-off-by: @houmingyong
2022-08-15 03:02:57 +00:00
yixiangzhike
262093afa9 Fix issue of error length and truncate dict file
Signed-off-by: yixiangzhike <yixiangzhike007@163.com>
2022-08-13 13:19:58 +08:00
openeuler-ci-bot
a636de40ab
!21 【openEuler-22.03-LTS-Next】Delete unused ld config file for python module _cracklib.so
From: @yixiangzhike 
Reviewed-by: @zhujianwei001 
Signed-off-by: @zhujianwei001
2022-04-12 01:40:52 +00:00
yixiangzhike
973c55ba39 Delete unused ld config file for python module _cracklib.so 2022-04-11 18:18:25 +08:00
openeuler-ci-bot
080acf69ad !20 【openEuler-22.03-LTS-Next】Fix lookup for word in FindPW
From: @yixiangzhike
Reviewed-by: @zhujianwei001
Signed-off-by: @zhujianwei001
2021-12-06 11:51:02 +00:00
yixiangzhike
da928e583d Fix lookup for word in FindPW() 2021-12-06 19:24:20 +08:00
8 changed files with 185 additions and 14 deletions

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

Binary file not shown.

BIN
cracklib-2.9.8.tar.gz Normal file

Binary file not shown.

View File

@ -4,15 +4,19 @@
%define dictpath %{dictdir}/pw_dict
Name: cracklib
Version: 2.9.7
Release: 7
Version: 2.9.8
Release: 2
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
# 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}
@ -21,10 +25,10 @@ BuildRequires: python3-devel
Conflicts: cracklib-dicts < 2.8
Requires: gzip
Provides: cracklib-dicts
Provides: cracklib-dicts = %{version}-%{release}
Provides: %{name}-python = %{version}-%{release}
Provides: %{name}-python%{?_isa} = %{version}-%{release}
Obsoletes: cracklib-dicts
Obsoletes: cracklib-dicts < %{version}-%{release}
Obsoletes: %{name}-python < %{version}-%{release}
%description
@ -122,9 +126,6 @@ chrpath -d $RPM_BUILD_ROOT/%{python3_sitearch}/_cracklib.so
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo "%{_libdir}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
%if %{with python3}
echo "%{_libdir}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/python3-%{name}-%{_arch}.conf
%endif
%find_lang %{name}
@ -160,10 +161,25 @@ make test
%{_libdir}/python3*/site-packages/_cracklib*.so
%{_libdir}/python3*/site-packages/*.py*
%{_libdir}/python3*/site-packages/__pycache__/*
%config(noreplace) /etc/ld.so.conf.d/python3-%{name}-%{_arch}.conf
%endif
%changelog
* Wed Apr 26 2023 yixiangzhike <yixiangzhike007@163.com> - 2.9.8-2
- add version for the symbol cracklib-dicts
* Fri Oct 21 2022 yixiangzhike <yixiangzhike007@163.com> - 2.9.8-1
- update to 2.9.8
* Sat Aug 13 2022 yixiangzhike <yixiangzhike007@163.com> - 2.9.7-10
- fix issue of truncating dict file without input data
- fix error length about simplistic password
* Mon Apr 11 2022 yixiangzhike <yixiangzhike007@163.com> - 2.9.7-9
- delete unused ld config file for python module _cracklib.so
* Mon Dec 6 2021 yixiangzhike <yixiangzhike007@163.com> - 2.9.7-8
- fix lookup for word in FindPW()
* Mon Sep 6 2021 yixiangzhike <zhangxingliang3@huawei.com> - 2.9.7-7
- delete rpath and runpath from exec files and libraries

View File

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

View File

@ -6,8 +6,8 @@ Subject: [PATCH] fix problem of error message about simplistic password
Signed-off-by: openEuler Buildteam <buildteam@openeuler.org>
---
lib/fascist.c | 33 ++++++++++++++++++++++++++++-----
util/cracklib-format | 10 ++++++----
2 files changed, 34 insertions(+), 9 deletions(-)
util/cracklib-format | 19 ++++++----
2 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/lib/fascist.c b/lib/fascist.c
index c5a018c..a1a8564 100644
@ -103,19 +103,28 @@ index c5a018c..a1a8564 100644
printf("%-16s (reversed dict)\n", a);
#endif
diff --git a/util/cracklib-format b/util/cracklib-format
index 1d7be5b..360d109 100755
index c133d75..360d109 100755
--- a/util/cracklib-format
+++ b/util/cracklib-format
@@ -3,8 +3,10 @@
@@ -3,17 +3,10 @@
# This preprocesses a set of word lists into a suitable form for input
# into cracklib-packer
#
-# Truncates lines longer than 1022 characters long as cracklib-packer
-# does not handle them correctly.
-#
-# The last part of the pipeline uses 'grep -v' to remove any blank
-# lines (possibly introduced by earlier parts of the pipeline) as
-# cracklib-packer will generate "skipping line" warnings otherwise.
-#
+LC_ALL=C
+export LC_ALL
gzip -cdf "$@" |
- grep -v '^\(#\|$\)' |
- grep -a -v '^#' |
- tr '[A-Z]' '[a-z]' |
- tr -cd '\012[a-z][0-9]' |
- cut -c 1-1022 |
- grep -v '^$' |
- env LC_ALL=C sort -u
+ grep -a -E -v '^.{30,}$' |
+ tr '[:upper:]' '[:lower:]' |

View File

@ -0,0 +1,61 @@
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