Compare commits

...
Sign in to create a new pull request.

47 commits

Author SHA1 Message Date
Fedora Release Engineering
268edecb67 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 18:47:34 +00:00
Fedora Release Engineering
ac34a7a48c Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 14:47:34 +00:00
Fedora Release Engineering
48f6fe27af Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 20:09:33 +00:00
Fedora Release Engineering
253ee10c45 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 08:21:30 +00:00
Fedora Release Engineering
4beb16080f Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 16:19:48 +00:00
Dmitry Belyavskiy
4c9957c90f migrated to SPDX license 2023-08-04 14:29:48 +02:00
Fedora Release Engineering
78da225975 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 16:32:59 +00:00
Paul Wouters
d2f5af3f9e
update to 2.9.11
- Resolves: rhbz#2123955 cracklib-2.9.11 is available
- Remove old patches, port remaining patches to 2.9.11
- Use man pages from doc/ instead of pulling them from debian
2023-07-07 21:38:07 -04:00
Fedora Release Engineering
1a51e53e47 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 00:38:18 +00:00
Paul Wouters
3217e5685b
move Url: and License: to a saner spot higher up in spec file 2022-08-30 19:42:25 -04:00
Parag Nemade
57c3c940ca
As -dicts subpackage installs files under %{_libdir} path it should not be noarch
this fixes FTBFS on F37+
2022-08-30 18:39:06 +05:30
Fedora Release Engineering
8e08eacebe Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-20 23:43:03 +00:00
Paul Wouters
7903ce885c
another stashes patch hunk that was removed in a stashed version 2022-03-07 21:48:25 -05:00
Paul Wouters
d3fefae733
update sources 2022-03-07 21:42:42 -05:00
Paul Wouters
6d9868a4c6
also apply stashed changes :P 2022-03-07 21:37:40 -05:00
Paul Wouters
620dc687b7
update to 2.9.7
Mostly a security fix release for CVE 2016-6318 which
was already fixed in Fedora.
2022-03-07 21:19:20 -05:00
Fedora Release Engineering
bd42e8f9cf - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-19 23:57:59 +00:00
Paul Wouters
5d99be852e
- Resolves: rhbz#1994196 Remove /usr/bin/packer symbolic link 2021-08-30 23:50:23 +03:00
Fedora Release Engineering
fab3ab8641 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 20:05:13 +00:00
Fedora Release Engineering
0cc486dfc5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 02:40:38 +00:00
Tom Stellard
3e85d8d26d Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2020-12-17 03:59:46 +00:00
Fedora Release Engineering
28dcf39ec1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 14:42:06 +00:00
Tom Stellard
32ce35d61a Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2020-07-13 18:54:59 +00:00
Fedora Release Engineering
8dcbcb28e3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 14:58:29 +00:00
Tomas Mraz
a11e8f0582 Drop Python 2 bindings completely 2019-08-09 16:46:56 +02:00
Fedora Release Engineering
2e9952380c - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-24 21:09:23 +00:00
Fedora Release Engineering
c7cf122685 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 16:23:54 +00:00
Igor Gnatenko
1595629cca Remove obsolete BuildRoot tag
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-29 05:34:36 +01:00
Igor Gnatenko
f67e241300 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:23:58 +01:00
Tomas Mraz
bc61ed0119 Fix regression in dictionary creation and lookup 2018-11-26 16:44:58 +01:00
Tomas Mraz
6d35644e4b Fix minor bug found in the Coverity scan 2018-10-10 14:36:31 +02:00
Tomas Mraz
e828818539 Updated translations 2018-10-09 12:18:30 +02:00
Tomas Mraz
673d98d62e Properly call python2 in check. 2018-07-13 14:24:02 +02:00
Tomas Mraz
8274cbbc56 The test must use the dictionary from the build 2018-07-13 13:59:23 +02:00
Fedora Release Engineering
4b67c0c867 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-12 22:19:52 +00:00
Jason Tibbitts
4dbc86aaca Remove needless use of %defattr 2018-07-10 00:33:52 -05:00
Tomas Mraz
811f0d1829 Drop debugging leftover 2018-02-21 13:16:24 +01:00
Tomas Mraz
68dc49109f Drop Python 2 support in RHEL 2018-02-21 13:14:59 +01:00
Fedora Release Engineering
09348f50cb - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 05:52:59 +00:00
Igor Gnatenko
f69740c948
Switch to %ldconfig_scriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-03 18:17:40 +01:00
Iryna Shcherbina
73c5a99220 Update Python 2 dependency declarations to new packaging standards 2018-01-03 11:16:12 +01:00
Andrei Stepanov
96682a090d Add CI tests using the standard test interface
Adds tests according to the CI wiki [0] specifically the standard test interface in the spec [1].

[0]: https://fedoraproject.org/wiki/CI
[1]: https://fedoraproject.org/wiki/Changes/InvokingTests
2017-10-17 15:01:06 +00:00
Zbigniew Jędrzejewski-Szmek
bd8f1f5510 Add Provides for the old name without %_isa 2017-08-20 09:23:26 -04:00
Zbigniew Jędrzejewski-Szmek
31ac5ac711 Python 2 binary package renamed to python2-cracklib 2017-08-19 09:38:10 -04:00
Fedora Release Engineering
0b46647a95 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 19:15:12 +00:00
Fedora Release Engineering
f1a74a691b - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 05:36:59 +00:00
Fedora Release Engineering
2edb3e61e3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 07:57:53 +00:00
17 changed files with 652 additions and 2929 deletions

6
.gitignore vendored
View file

@ -54,3 +54,9 @@ cracklib-2.8.16.tar.gz
/cracklib-2.9.6.tar.gz
/cracklib-words-2.9.6.gz
/missing-words.gz
/cracklib-2.9.7.tar.gz
/cracklib-words-2.9.7.gz
/cracklib2_2.9.2-1.debian.tar.xz
/cracklib2_2.9.2-1.dsc
/cracklib-2.9.11.tar.gz
/cracklib-words-2.9.11.gz

View file

@ -1,104 +0,0 @@
diff -up cracklib-2.9.0/python/_cracklib.c.gzdicts cracklib-2.9.0/python/_cracklib.c
--- cracklib-2.9.0/python/_cracklib.c.gzdicts 2013-06-01 16:47:13.000000000 +0200
+++ cracklib-2.9.0/python/_cracklib.c 2013-08-20 12:37:32.028611493 +0200
@@ -23,6 +23,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
#ifdef PYTHON_H
#include PYTHON_H
#else
@@ -72,9 +73,8 @@ static char _cracklib_FascistCheck_doc [
static PyObject *
_cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs)
{
- char *candidate, *dict;
- char *defaultdict = NULL;
- const char *result;
+ char *candidate;
+ const char *result, *dict;
struct stat st;
char *keywords[] = {"pw", "dictpath", NULL};
char *dictfile;
@@ -103,44 +103,35 @@ _cracklib_FascistCheck(PyObject *self, P
"second argument was not an absolute path!");
return NULL;
}
- dictfile = malloc(strlen(dict) + sizeof(DICT_SUFFIX));
- if (dictfile == NULL)
- {
- PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict);
- return NULL;
- }
- sprintf(dictfile, "%s" DICT_SUFFIX, dict);
- if (lstat(dictfile, &st) == -1)
- {
- PyErr_SetFromErrnoWithFilename(PyExc_OSError, dictfile);
- free(dictfile);
- return NULL;
- }
- free(dictfile);
} else
{
- defaultdict = strdup(GetDefaultCracklibDict());
- if (errno == ENOMEM) {
- PyErr_SetFromErrno(PyExc_OSError);
- return NULL;
- }
- dictfile = malloc(strlen(defaultdict) + sizeof(DICT_SUFFIX));
- if (dictfile == NULL)
- {
- PyErr_SetFromErrnoWithFilename(PyExc_OSError, defaultdict);
- free(defaultdict);
- return NULL;
- }
- sprintf(dictfile, "%s" DICT_SUFFIX, defaultdict);
+ /* No need to strdup() anything as this is a constant value */
+ dict = GetDefaultCracklibDict();
+ }
+
+ dictfile = malloc(strlen(dict) + sizeof(DICT_SUFFIX) + 3);
+ if (dictfile == NULL)
+ {
+ PyErr_SetFromErrnoWithFilename(PyExc_OSError, dict);
+ return NULL;
+ }
+ sprintf(dictfile, "%s" DICT_SUFFIX, dict);
+ if (lstat(dictfile, &st) == -1)
+ {
+#ifdef HAVE_ZLIB_H
+ sprintf(dictfile, "%s" DICT_SUFFIX ".gz", dict);
if (lstat(dictfile, &st) == -1)
{
+ sprintf(dictfile, "%s" DICT_SUFFIX, dict);
+#endif
PyErr_SetFromErrnoWithFilename(PyExc_OSError, dictfile);
- free(defaultdict);
free(dictfile);
return NULL;
+#ifdef HAVE_ZLIB_H
}
- free(dictfile);
+#endif
}
+ free(dictfile);
setlocale(LC_ALL, "");
#ifdef ENABLE_NLS
@@ -148,14 +139,9 @@ _cracklib_FascistCheck(PyObject *self, P
#endif
LOCK();
- result = FascistCheck(candidate, dict ? dict : defaultdict);
+ result = FascistCheck(candidate, dict);
UNLOCK();
- if (defaultdict != NULL)
- {
- free(defaultdict);
- }
-
if (result != NULL)
{
PyErr_SetString(PyExc_ValueError, result);

View file

@ -1,22 +0,0 @@
Do not depend on config.h in public header.
diff -up cracklib-2.9.1/lib/packer.h.inttypes cracklib-2.9.1/lib/packer.h
--- cracklib-2.9.1/lib/packer.h.inttypes 2013-12-03 15:00:15.000000000 +0100
+++ cracklib-2.9.1/lib/packer.h 2013-12-09 09:07:38.306394809 +0100
@@ -30,17 +30,7 @@
#define _(String) (String)
#endif
-#if defined(HAVE_INTTYPES_H)
-#include <inttypes.h>
-#else
-#if defined(HAVE_STDINT_H)
#include <stdint.h>
-#else
-typedef unsigned int uint32_t;
-typedef unsigned short uint16_t;
-#endif
-#endif
-
struct pi_header
{

View file

@ -1,7 +1,7 @@
diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
--- cracklib-2.9.6/lib/fascist.c.reentrant 2015-08-18 20:41:16.000000000 +0200
+++ cracklib-2.9.6/lib/fascist.c 2015-10-22 18:17:20.338290974 +0200
@@ -36,8 +36,8 @@ typedef unsigned short uint16_t;
diff -Naur cracklib-2.9.11-orig/lib/fascist.c cracklib-2.9.11/lib/fascist.c
--- cracklib-2.9.11-orig/lib/fascist.c 2019-02-13 20:54:41.000000000 -0500
+++ cracklib-2.9.11/lib/fascist.c 2023-07-07 18:20:42.239904964 -0400
@@ -36,8 +36,8 @@
#undef DEBUG
#undef DEBUG2
@ -12,7 +12,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
static char *r_destructors[] = {
":", /* noop - must do this to test raw word. */
@@ -439,6 +439,8 @@ GTry(rawtext, password)
@@ -439,6 +439,8 @@
int i;
int len;
char *mp;
@ -21,7 +21,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
/* use destructors to turn password into rawtext */
/* note use of Reverse() to save duplicating all rules */
@@ -447,7 +449,7 @@ GTry(rawtext, password)
@@ -447,7 +449,7 @@
for (i = 0; r_destructors[i]; i++)
{
@ -30,7 +30,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
{
continue;
}
@@ -462,10 +464,10 @@ GTry(rawtext, password)
@@ -462,10 +464,10 @@
}
#ifdef DEBUG
@ -43,7 +43,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
{
return (1);
}
@@ -473,7 +475,7 @@ GTry(rawtext, password)
@@ -473,7 +475,7 @@
for (i = 0; r_constructors[i]; i++)
{
@ -52,7 +52,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
{
continue;
}
@@ -520,7 +522,7 @@ FascistGecosUser(char *password, const c
@@ -520,7 +522,7 @@
strncpy(tbuffer, gecos, STRINGSIZE);
tbuffer[STRINGSIZE-1] = '\0';
@ -61,7 +61,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
wc = 0;
ptr = gbuffer;
@@ -695,6 +697,7 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -704,6 +706,7 @@
char junk[STRINGSIZE];
char *password;
char rpassword[STRINGSIZE];
@ -69,7 +69,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
uint32_t notfound;
notfound = PW_WORDS(pwp);
@@ -731,7 +734,7 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -740,7 +743,7 @@
return _("it does not contain enough DIFFERENT characters");
}
@ -78,7 +78,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
Trim(password);
@@ -787,7 +790,7 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -796,7 +799,7 @@
{
char *a;
@ -87,7 +87,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
{
continue;
}
@@ -802,13 +805,13 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -811,13 +814,13 @@
}
}
@ -103,10 +103,10 @@ diff -up cracklib-2.9.6/lib/fascist.c.reentrant cracklib-2.9.6/lib/fascist.c
{
continue;
}
diff -up cracklib-2.9.6/lib/packer.h.reentrant cracklib-2.9.6/lib/packer.h
--- cracklib-2.9.6/lib/packer.h.reentrant 2015-10-22 18:17:20.335290902 +0200
+++ cracklib-2.9.6/lib/packer.h 2015-10-22 18:17:20.338290974 +0200
@@ -82,7 +82,7 @@ extern int PWClose(PWDICT *pwp);
diff -Naur cracklib-2.9.11-orig/lib/packer.h cracklib-2.9.11/lib/packer.h
--- cracklib-2.9.11-orig/lib/packer.h 2023-03-04 11:00:49.000000000 -0500
+++ cracklib-2.9.11/lib/packer.h 2023-07-07 18:21:04.315119032 -0400
@@ -82,7 +82,7 @@
extern unsigned int FindPW(PWDICT *pwp, char *string);
extern int PutPW(PWDICT *pwp, char *string);
extern int PMatch(char *control, char *string);
@ -115,10 +115,10 @@ diff -up cracklib-2.9.6/lib/packer.h.reentrant cracklib-2.9.6/lib/packer.h
extern char Chop(char *string);
extern char *Trim(char *string);
extern char *FascistLook(PWDICT *pwp, char *instring);
diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
--- cracklib-2.9.6/lib/packlib.c.reentrant 2015-08-18 20:41:16.000000000 +0200
+++ cracklib-2.9.6/lib/packlib.c 2015-10-22 18:19:52.154911451 +0200
@@ -67,8 +67,8 @@ PWOpen(prefix, mode)
diff -Naur cracklib-2.9.11-orig/lib/packlib.c cracklib-2.9.11/lib/packlib.c
--- cracklib-2.9.11-orig/lib/packlib.c 2023-03-04 11:00:49.000000000 -0500
+++ cracklib-2.9.11/lib/packlib.c 2023-07-07 18:44:55.183214284 -0400
@@ -65,8 +65,8 @@
char *mode;
{
int use64 = 0;
@ -129,7 +129,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
char iname[STRINGSIZE];
char dname[STRINGSIZE];
char wname[STRINGSIZE];
@@ -76,13 +76,11 @@ PWOpen(prefix, mode)
@@ -74,13 +74,11 @@
void *ifp;
void *wfp;
@ -146,7 +146,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
memset(&pdesc64, '\0', sizeof(pdesc64));
snprintf(iname, STRINGSIZE, "%s.pwi", prefix);
@@ -91,77 +89,80 @@ PWOpen(prefix, mode)
@@ -89,77 +87,80 @@
if (mode[0] == 'r')
{
@ -195,7 +195,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
#ifdef HAVE_ZLIB_H
- if (pdesc.flags & PFOR_USEZLIB)
- gzclose(pdesc.dfp);
+ if(pdesc->flags & PFOR_USEZLIB)
+ if (pdesc->flags & PFOR_USEZLIB)
+ gzclose(pdesc->dfp);
else
#endif
@ -247,11 +247,11 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
fclose(ifp);
#ifdef HAVE_ZLIB_H
- if (pdesc.flags & PFOR_USEZLIB)
+ if(pdesc->flags & PFOR_USEZLIB)
+ if (pdesc->flags & PFOR_USEZLIB)
gzclose(dfp);
else
#endif
@@ -170,10 +171,11 @@ PWOpen(prefix, mode)
@@ -168,10 +169,11 @@
{
fclose(wfp);
}
@ -264,7 +264,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
{
/* uh-oh. either a broken "64-bit" file or a garbage file. */
rewind (ifp);
@@ -181,10 +183,9 @@ PWOpen(prefix, mode)
@@ -179,10 +181,9 @@
{
fprintf(stderr, "%s: error reading header\n", prefix);
@ -276,15 +276,15 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
gzclose(dfp);
else
#endif
@@ -193,6 +194,7 @@ PWOpen(prefix, mode)
@@ -191,6 +192,7 @@
{
fclose(wfp);
}
+ free(pdesc);
+ free(pdesc);
return NULL;
}
if (pdesc64.header.pih_magic != PIH_MAGIC)
@@ -200,10 +202,9 @@ PWOpen(prefix, mode)
@@ -198,10 +200,9 @@
/* nope, not "64-bit" after all */
fprintf(stderr, "%s: error reading header\n", prefix);
@ -296,11 +296,11 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
gzclose(dfp);
else
#endif
@@ -213,23 +214,23 @@ PWOpen(prefix, mode)
@@ -211,23 +212,23 @@
{
fclose(wfp);
}
+ free(pdesc);
+ free(pdesc);
return NULL;
}
- pdesc.header.pih_magic = pdesc64.header.pih_magic;
@ -327,7 +327,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
gzclose(dfp);
else
#endif
@@ -239,17 +240,17 @@ PWOpen(prefix, mode)
@@ -237,17 +238,17 @@
{
fclose(wfp);
}
@ -348,7 +348,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
gzclose(dfp);
else
#endif
@@ -258,17 +259,17 @@ PWOpen(prefix, mode)
@@ -256,17 +257,17 @@
{
fclose(wfp);
}
@ -369,7 +369,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
gzclose(dfp);
else
#endif
@@ -277,10 +278,11 @@ PWOpen(prefix, mode)
@@ -275,10 +276,11 @@
{
fclose(wfp);
}
@ -382,7 +382,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
{
int i;
@@ -288,27 +290,27 @@ PWOpen(prefix, mode)
@@ -286,27 +288,27 @@
{
if (fread(pdesc64.hwms, 1, sizeof(pdesc64.hwms), wfp) != sizeof(pdesc64.hwms))
{
@ -395,9 +395,8 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
- pdesc.hwms[i] = pdesc64.hwms[i];
+ pdesc->hwms[i] = pdesc64.hwms[i];
}
- }
}
- else if (fread(pdesc.hwms, 1, sizeof(pdesc.hwms), wfp) != sizeof(pdesc.hwms))
+ }
+ else if (fread(pdesc->hwms, 1, sizeof(pdesc->hwms), wfp) != sizeof(pdesc->hwms))
{
- pdesc.flags &= ~PFOR_USEHWMS;
@ -418,15 +417,7 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
}
int
@@ -318,6 +320,7 @@ PWClose(pwp)
if (pwp->header.pih_magic != PIH_MAGIC)
{
fprintf(stderr, "PWClose: close magic mismatch\n");
+ /* we do not try to free memory that is probably corrupted */
return (-1);
}
@@ -329,12 +332,14 @@ PWClose(pwp)
@@ -327,12 +329,14 @@
if (fseek(pwp->ifp, 0L, 0))
{
fprintf(stderr, "index magic fseek failed\n");
@ -437,11 +428,11 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp))
{
fprintf(stderr, "index magic fwrite failed\n");
+ free(pwp);
+ free(pwp);
return (-1);
}
@@ -368,6 +373,7 @@ PWClose(pwp)
@@ -366,6 +370,7 @@
}
pwp->header.pih_magic = 0;
@ -449,143 +440,143 @@ diff -up cracklib-2.9.6/lib/packlib.c.reentrant cracklib-2.9.6/lib/packlib.c
return (0);
}
diff -up cracklib-2.9.6/lib/rules.c.reentrant cracklib-2.9.6/lib/rules.c
--- cracklib-2.9.6/lib/rules.c.reentrant 2015-08-18 20:41:16.000000000 +0200
+++ cracklib-2.9.6/lib/rules.c 2015-10-22 18:17:20.339290998 +0200
@@ -82,12 +82,12 @@ Suffix(myword, suffix)
diff -Naur cracklib-2.9.11-orig/lib/rules.c cracklib-2.9.11/lib/rules.c
--- cracklib-2.9.11-orig/lib/rules.c 2023-04-02 14:15:05.000000000 -0400
+++ cracklib-2.9.11/lib/rules.c 2023-07-07 18:58:04.892943574 -0400
@@ -80,12 +80,12 @@
}
char *
-Reverse(str) /* return a pointer to a reversal */
+Reverse(str, area) /* return a pointer to a reversal */
register char *str;
char *str;
+ char *area;
{
register int i;
register int j;
int i;
int j;
- static char area[STRINGSIZE];
j = i = strlen(str);
while (*str)
{
@@ -98,11 +98,11 @@ Reverse(str) /* return a pointer to a
@@ -96,11 +96,11 @@
}
char *
-Uppercase(str) /* return a pointer to an uppercase */
+Uppercase(str, area) /* return a pointer to an uppercase */
register char *str;
char *str;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*str)
{
@@ -115,11 +115,11 @@ Uppercase(str) /* return a pointer to
@@ -113,11 +113,11 @@
}
char *
-Lowercase(str) /* return a pointer to an lowercase */
+Lowercase(str, area) /* return a pointer to an lowercase */
register char *str;
char *str;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*str)
{
@@ -132,11 +132,11 @@ Lowercase(str) /* return a pointer to
@@ -130,11 +130,11 @@
}
char *
-Capitalise(str) /* return a pointer to an capitalised */
+Capitalise(str, area) /* return a pointer to an capitalised */
register char *str;
char *str;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*str)
@@ -151,11 +151,11 @@ Capitalise(str) /* return a pointer to
@@ -149,11 +149,11 @@
}
char *
-Pluralise(string) /* returns a pointer to a plural */
+Pluralise(string, area) /* returns a pointer to a plural */
register char *string;
char *string;
+ char *area;
{
register int length;
int length;
- static char area[STRINGSIZE];
length = strlen(string);
strcpy(area, string);
@@ -192,13 +192,13 @@ Pluralise(string) /* returns a pointer
@@ -190,13 +190,13 @@
}
char *
-Substitute(string, old, new) /* returns pointer to a swapped about copy */
+Substitute(string, old, new, area) /* returns pointer to a swapped about copy */
register char *string;
register char old;
register char new;
char *string;
char old;
char new;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*string)
{
@@ -210,12 +210,12 @@ Substitute(string, old, new) /* returns
@@ -208,12 +208,12 @@
}
char *
-Purge(string, target) /* returns pointer to a purged copy */
+Purge(string, target, area) /* returns pointer to a purged copy */
register char *string;
register char target;
char *string;
char target;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*string)
{
@@ -372,13 +372,13 @@ PolyStrchr(string, class)
@@ -370,13 +370,13 @@
}
char *
-PolySubst(string, class, new) /* returns pointer to a swapped about copy */
+PolySubst(string, class, new, area) /* returns pointer to a swapped about copy */
register char *string;
register char class;
register char new;
char *string;
char class;
char new;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*string)
{
@@ -390,12 +390,12 @@ PolySubst(string, class, new) /* returns
@@ -388,12 +388,12 @@
}
char *
-PolyPurge(string, class) /* returns pointer to a purged copy */
+PolyPurge(string, class, area) /* returns pointer to a purged copy */
register char *string;
register char class;
char *string;
char class;
+ char *area;
{
register char *ptr;
char *ptr;
- static char area[STRINGSIZE];
ptr = area;
while (*string)
{
@@ -428,40 +428,41 @@ Char2Int(character)
@@ -426,39 +426,40 @@
}
char *
@ -596,10 +587,9 @@ diff -up cracklib-2.9.6/lib/rules.c.reentrant cracklib-2.9.6/lib/rules.c
+ char *area;
{
int limit;
register char *ptr;
- static char area[STRINGSIZE];
char area2[STRINGSIZE];
area[0] = '\0';
char *ptr;
- static char area[STRINGSIZE * 2] = {0};
char area2[STRINGSIZE * 2] = {0};
strcpy(area, input);
for (ptr = control; *ptr; ptr++)
@ -635,7 +625,7 @@ diff -up cracklib-2.9.6/lib/rules.c.reentrant cracklib-2.9.6/lib/rules.c
break;
case RULE_DUPLICATE:
strcpy(area2, area);
@@ -548,7 +549,6 @@ Mangle(input, control) /* returns a poi
@@ -545,7 +546,6 @@
Debug(1, "Mangle: extract: weird argument in '%s'\n", control);
return NULL;
}
@ -643,7 +633,7 @@ diff -up cracklib-2.9.6/lib/rules.c.reentrant cracklib-2.9.6/lib/rules.c
for (i = 0; length-- && area2[start + i]; i++)
{
area[i] = area2[start + i];
@@ -619,10 +619,10 @@ Mangle(input, control) /* returns a poi
@@ -616,10 +616,10 @@
return NULL;
} else if (ptr[1] != RULE_CLASS)
{
@ -656,7 +646,7 @@ diff -up cracklib-2.9.6/lib/rules.c.reentrant cracklib-2.9.6/lib/rules.c
ptr += 2;
}
break;
@@ -633,11 +633,11 @@ Mangle(input, control) /* returns a poi
@@ -630,11 +630,11 @@
return NULL;
} else if (ptr[1] != RULE_CLASS)
{

View file

@ -1,7 +1,7 @@
diff -up cracklib-2.9.6/lib/fascist.c.simplistic cracklib-2.9.6/lib/fascist.c
--- cracklib-2.9.6/lib/fascist.c.simplistic 2015-10-22 18:21:51.099748012 +0200
+++ cracklib-2.9.6/lib/fascist.c 2015-10-22 18:21:51.101748060 +0200
@@ -55,7 +55,6 @@ static char *r_destructors[] = {
diff -Naur cracklib-2.9.11-orig/lib/fascist.c cracklib-2.9.11/lib/fascist.c
--- cracklib-2.9.11-orig/lib/fascist.c 2023-07-07 21:18:25.582821076 -0400
+++ cracklib-2.9.11/lib/fascist.c 2023-07-07 21:19:55.130234075 -0400
@@ -55,7 +55,6 @@
"/?p@?p", /* purging out punctuation/symbols/junk */
"/?s@?s",
@ -9,33 +9,33 @@ diff -up cracklib-2.9.6/lib/fascist.c.simplistic cracklib-2.9.6/lib/fascist.c
/* attempt reverse engineering of password strings */
@@ -454,6 +453,12 @@ GTry(rawtext, password)
@@ -454,6 +453,12 @@
continue;
}
+ if (len - strlen(mp) >= 3)
+ {
+ /* purged too much */
+ continue;
+ /* purged too much */
+ continue;
+ }
+
#ifdef DEBUG
printf("%-16s = %-16s (destruct %s)\n", mp, rawtext, r_destructors[i]);
#endif
@@ -480,6 +485,12 @@ GTry(rawtext, password)
@@ -480,6 +485,12 @@
continue;
}
+ if (len - strlen(mp) >= 3)
+ {
+ /* purged too much */
+ continue;
+ /* purged too much */
+ continue;
+ }
+
#ifdef DEBUG
printf("%-16s = %-16s (construct %s)\n", mp, password, r_constructors[i]);
#endif
@@ -699,6 +710,7 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -708,6 +719,7 @@
char rpassword[STRINGSIZE];
char area[STRINGSIZE];
uint32_t notfound;
@ -43,7 +43,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.simplistic cracklib-2.9.6/lib/fascist.c
notfound = PW_WORDS(pwp);
/* already truncated if from FascistCheck() */
@@ -748,6 +760,7 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -757,6 +769,7 @@
return _("it is all whitespace");
}
@ -51,7 +51,7 @@ diff -up cracklib-2.9.6/lib/fascist.c.simplistic cracklib-2.9.6/lib/fascist.c
i = 0;
ptr = password;
while (ptr[0] && ptr[1])
@@ -759,10 +772,9 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -768,10 +781,9 @@
ptr++;
}
@ -60,53 +60,52 @@ diff -up cracklib-2.9.6/lib/fascist.c.simplistic cracklib-2.9.6/lib/fascist.c
- maxrepeat = 3+(0.09*strlen(password));
- if (i > maxrepeat)
+ /* We were still generating false positives for long passwords.
+ Just count systematic double as a single character. */
+ Just count systematic double as a single character. */
+ if (len - i < MINLEN)
{
return _("it is too simplistic/systematic");
}
@@ -795,6 +807,12 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -804,6 +816,12 @@
continue;
}
+ if (len - strlen(a) >= 3)
+ {
+ /* purged too much */
+ continue;
+ /* purged too much */
+ continue;
+ }
+
#ifdef DEBUG
printf("%-16s (dict)\n", a);
#endif
@@ -815,6 +833,13 @@ FascistLookUser(PWDICT *pwp, char *instr
@@ -824,6 +842,13 @@
{
continue;
}
+
+ if (len - strlen(a) >= 3)
+ {
+ /* purged too much */
+ continue;
+ /* purged too much */
+ continue;
+ }
+
#ifdef DEBUG
printf("%-16s (reversed dict)\n", a);
#endif
diff -up cracklib-2.9.6/util/cracklib-format.simplistic cracklib-2.9.6/util/cracklib-format
--- cracklib-2.9.6/util/cracklib-format.simplistic 2015-10-22 18:21:51.101748060 +0200
+++ cracklib-2.9.6/util/cracklib-format 2014-07-09 17:24:45.000000000 +0200
@@ -3,8 +3,10 @@
# This preprocesses a set of word lists into a suitable form for input
# into cracklib-packer
diff -Naur cracklib-2.9.11-orig/util/cracklib-format cracklib-2.9.11/util/cracklib-format
--- cracklib-2.9.11-orig/util/cracklib-format 2021-01-22 10:58:14.000000000 -0500
+++ cracklib-2.9.11/util/cracklib-format 2023-07-07 21:19:14.854048317 -0400
@@ -10,10 +10,12 @@
# 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 '^\(#\|$\)' |
- tr '[A-Z]' '[a-z]' |
- tr -cd '\012[a-z][0-9]' |
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:]' |
+ tr -cd '\n[:graph:]' |
+ sort -u

View file

@ -1,144 +0,0 @@
diff -up cracklib-2.9.6/lib/fascist.c.overflow cracklib-2.9.6/lib/fascist.c
--- cracklib-2.9.6/lib/fascist.c.overflow 2015-10-23 16:58:38.403319225 +0200
+++ cracklib-2.9.6/lib/fascist.c 2016-12-08 17:28:41.490101358 +0100
@@ -515,7 +515,7 @@ FascistGecosUser(char *password, const c
char gbuffer[STRINGSIZE];
char tbuffer[STRINGSIZE];
char *uwords[STRINGSIZE];
- char longbuffer[STRINGSIZE * 2];
+ char longbuffer[STRINGSIZE];
if (gecos == NULL)
gecos = "";
@@ -596,38 +596,47 @@ FascistGecosUser(char *password, const c
{
for (i = 0; i < j; i++)
{
- strcpy(longbuffer, uwords[i]);
- strcat(longbuffer, uwords[j]);
-
- if (GTry(longbuffer, password))
+ if (strlen(uwords[i]) + strlen(uwords[j]) < STRINGSIZE)
{
- return _("it is derived from your password entry");
- }
-
- strcpy(longbuffer, uwords[j]);
- strcat(longbuffer, uwords[i]);
+ strcpy(longbuffer, uwords[i]);
+ strcat(longbuffer, uwords[j]);
- if (GTry(longbuffer, password))
- {
- return _("it's derived from your password entry");
+ if (GTry(longbuffer, password))
+ {
+ return _("it is derived from your password entry");
+ }
+
+ strcpy(longbuffer, uwords[j]);
+ strcat(longbuffer, uwords[i]);
+
+ if (GTry(longbuffer, password))
+ {
+ return _("it's derived from your password entry");
+ }
}
- longbuffer[0] = uwords[i][0];
- longbuffer[1] = '\0';
- strcat(longbuffer, uwords[j]);
-
- if (GTry(longbuffer, password))
+ if (strlen(uwords[j]) < STRINGSIZE - 1)
{
- return _("it is derivable from your password entry");
+ longbuffer[0] = uwords[i][0];
+ longbuffer[1] = '\0';
+ strcat(longbuffer, uwords[j]);
+
+ if (GTry(longbuffer, password))
+ {
+ return _("it is derivable from your password entry");
+ }
}
- longbuffer[0] = uwords[j][0];
- longbuffer[1] = '\0';
- strcat(longbuffer, uwords[i]);
-
- if (GTry(longbuffer, password))
+ if (strlen(uwords[i]) < STRINGSIZE - 1)
{
- return _("it's derivable from your password entry");
+ longbuffer[0] = uwords[j][0];
+ longbuffer[1] = '\0';
+ strcat(longbuffer, uwords[i]);
+
+ if (GTry(longbuffer, password))
+ {
+ return _("it's derivable from your password entry");
+ }
}
}
}
diff -up cracklib-2.9.6/lib/rules.c.overflow cracklib-2.9.6/lib/rules.c
--- cracklib-2.9.6/lib/rules.c.overflow 2015-10-23 16:58:38.000000000 +0200
+++ cracklib-2.9.6/lib/rules.c 2016-12-08 18:03:27.041941297 +0100
@@ -158,6 +158,8 @@ Pluralise(string, area) /* returns a po
register int length;
length = strlen(string);
strcpy(area, string);
+ if (length > STRINGSIZE - 3) /* we add 2 characters at worst */
+ return (area);
if (!Suffix(string, "ch") ||
!Suffix(string, "ex") ||
@@ -462,11 +464,11 @@ Mangle(input, control, area) /* returns
Pluralise(area2, area);
break;
case RULE_REFLECT:
- strcat(area, Reverse(area, area2));
+ strncat(area, Reverse(area, area2), STRINGSIZE - strlen(area) - 1);
break;
case RULE_DUPLICATE:
strcpy(area2, area);
- strcat(area, area2);
+ strncat(area, area2, STRINGSIZE - strlen(area) - 1);
break;
case RULE_GT:
if (!ptr[1])
@@ -514,7 +516,8 @@ Mangle(input, control, area) /* returns
} else
{
area2[0] = *(++ptr);
- strcpy(area2 + 1, area);
+ strncpy(area2 + 1, area, STRINGSIZE - 2);
+ area2[STRINGSIZE - 1] = '\0';
strcpy(area, area2);
}
break;
@@ -528,8 +531,10 @@ Mangle(input, control, area) /* returns
register char *string;
string = area;
while (*(string++));
- string[-1] = *(++ptr);
- *string = '\0';
+ if (string < area + STRINGSIZE) {
+ string[-1] = *(++ptr);
+ *string = '\0';
+ }
}
break;
case RULE_EXTRACT:
@@ -600,6 +605,10 @@ Mangle(input, control, area) /* returns
}
p1 = area;
p2 = area2;
+ if (strlen(p1) > STRINGSIZE - 2) {
+ /* truncate */
+ p1[STRINGSIZE - 2] = '\0';
+ }
while (i && *p1)
{
i--;

File diff suppressed because it is too large Load diff

View file

@ -4,32 +4,23 @@
Summary: A password-checking library
Name: cracklib
Version: 2.9.6
Release: 4%{?dist}
Group: System Environment/Libraries
Source0: https://github.com/cracklib/cracklib/releases/download/cracklib-%{version}/cracklib-%{version}.tar.gz
Source1: https://github.com/cracklib/cracklib/releases/download/cracklib-%{version}/cracklib-words-%{version}.gz
# For man pages.
Source2: http://ftp.us.debian.org/debian/pool/main/c/cracklib2/cracklib2_2.8.19-1.debian.tar.gz
Source40: http://ftp.us.debian.org/debian/pool/main/c/cracklib2/cracklib2_2.8.19-1.dsc
Version: 2.9.11
Release: 8%{?dist}
URL: https://github.com/cracklib/cracklib
License: LGPL-2.1-or-later
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
# From attachment to https://bugzilla.redhat.com/show_bug.cgi?id=627449
Source3: cracklib.default.zh_CN.po
Source2: cracklib.default.zh_CN.po
# No upstream source for this, just words missing from the current cracklib-words
Source10: missing-words.gz
Source3: missing-words.gz
Patch1: cracklib-2.9.1-inttypes.patch
Patch2: cracklib-2.9.0-python-gzdicts.patch
Patch4: cracklib-2.9.6-packlib-reentrant.patch
Patch6: cracklib-2.9.6-simplistic.patch
Patch7: cracklib-2.9.6-translation-updates.patch
Patch8: cracklib-2.9.6-cve-2016-6318.patch
URL: http://sourceforge.net/projects/cracklib/
License: LGPLv2+
Buildroot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: python-devel, words, gettext
Patch: cracklib-2.9.11-packlib-reentrant.patch
Patch: cracklib-2.9.11-simplistic.patch
BuildRequires: gcc
BuildRequires: words, gettext
BuildRequires: gettext-autopoint
BuildRequires: zlib-devel
Conflicts: cracklib-dicts < 2.8
@ -56,26 +47,16 @@ CrackLib, you will also want to install the cracklib-dicts package.
%package devel
Summary: Development files needed for building applications which use cracklib
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The cracklib-devel package contains the header files and libraries needed
for compiling applications which use cracklib.
%package python
Summary: Python bindings for applications which use cracklib
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description python
The cracklib-python package contains a module which permits applications
written in the Python programming language to use cracklib.
%package dicts
Summary: The standard CrackLib dictionaries
Group: System Environment/Libraries
BuildRequires: words >= 2-13
BuildRequires: make
Requires: cracklib = %{version}-%{release}
%description dicts
@ -87,113 +68,73 @@ contains the utilities necessary for the creation of new dictionaries.
If you are installing CrackLib, you should also install cracklib-dicts.
%prep
%setup -q -a 2
%autosetup -p 1
# Replace zn_CN.po with one that wasn't mis-transcoded at some point.
grep '????????????????' po/zh_CN.po
install -p -m 644 %{SOURCE3} po/zh_CN.po
%patch1 -p1 -b .inttypes
%patch2 -p1 -b .gzdicts
%patch4 -p1 -b .reentrant
%patch6 -p1 -b .simplistic
%patch7 -p1 -b .translations
%patch8 -p1 -b .overflow
install -p -m 644 %{SOURCE2} po/zh_CN.po
mkdir cracklib-dicts
for dict in %{SOURCE10} %{SOURCE1}
for dict in %{SOURCE3} %{SOURCE1}
do
cp -fv ${dict} cracklib-dicts/
done
chmod +x util/cracklib-format
%build
%configure --with-pic --with-python --with-default-dict=%{dictpath} --disable-static
# Use the dictionary from the build to test
sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in
%configure --with-pic \
--without-python \
--with-default-dict=%{dictpath} --disable-static
make -C po update-gmo
make
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}'
%make_install 'pythondir=${pyexecdir}'
./util/cracklib-format cracklib-dicts/* | \
./util/cracklib-packer $RPM_BUILD_ROOT/%{dictpath}
./util/cracklib-format $RPM_BUILD_ROOT/%{dictdir}/cracklib-small | \
./util/cracklib-packer $RPM_BUILD_ROOT/%{dictdir}/cracklib-small
rm -f $RPM_BUILD_ROOT/%{dictdir}/cracklib-small
sed s,/usr/lib/cracklib_dict,%{dictpath},g lib/crack.h > $RPM_BUILD_ROOT/%{_includedir}/crack.h
ln -s cracklib-format $RPM_BUILD_ROOT/%{_sbindir}/mkdict
ln -s cracklib-packer $RPM_BUILD_ROOT/%{_sbindir}/packer
touch $RPM_BUILD_ROOT/top
./util/cracklib-packer %{buildroot}%{dictpath}
./util/cracklib-format %{buildroot}%{dictdir}/cracklib-small | \
./util/cracklib-packer %{buildroot}%{dictdir}/cracklib-small
rm -f %{buildroot}%{dictdir}/cracklib-small
sed s,/usr/lib/cracklib_dict,%{dictpath},g lib/crack.h > %{buildroot}%{_includedir}/crack.h
ln -s cracklib-format %{buildroot}%{_sbindir}/mkdict
# packer link removed as it clashes with hashicorp's packer binary.
#ln -s cracklib-packer %{buildroot}/%{_sbindir}/packer
touch %{buildroot}/top
toprelpath=..
touch $RPM_BUILD_ROOT/top
while ! test -f $RPM_BUILD_ROOT/%{_libdir}/$toprelpath/top ; do
touch %{buildroot}/top
while ! test -f %{buildroot}%{_libdir}/$toprelpath/top ; do
toprelpath=../$toprelpath
done
rm -f $RPM_BUILD_ROOT/top
rm -f %{buildroot}/top
if test %{dictpath} != %{_libdir}/cracklib_dict ; then
ln -s $toprelpath%{dictpath}.hwm $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.hwm
ln -s $toprelpath%{dictpath}.pwd $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.pwd
ln -s $toprelpath%{dictpath}.pwi $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.pwi
ln -s $toprelpath%{dictpath}.hwm %{buildroot}%{_libdir}/cracklib_dict.hwm
ln -s $toprelpath%{dictpath}.pwd %{buildroot}%{_libdir}/cracklib_dict.pwd
ln -s $toprelpath%{dictpath}.pwi %{buildroot}%{_libdir}/cracklib_dict.pwi
fi
rm -f $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/_cracklib*.*a
rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la
rm -f %{buildroot}%{_libdir}/python*/site-packages/_cracklib*.*a
rm -f %{buildroot}%{_libdir}/libcrack.la
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man{3,8}
install -p -m644 debian/*.3 $RPM_BUILD_ROOT/%{_mandir}/man3/
install -p -m644 debian/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8/
if ! test -s $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-packer.8 ; then
echo .so man8/cracklib-format.8 > $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-packer.8
mkdir -p %{buildroot}%{_mandir}/man{3,8}
install -p -m644 doc/*.3 %{buildroot}%{_mandir}/man3/
install -p -m644 doc/*.8 %{buildroot}%{_mandir}/man8/
if ! test -s %{buildroot}%{_mandir}/man8/cracklib-packer.8 ; then
echo .so man8/cracklib-format.8 > %{buildroot}%{_mandir}/man8/cracklib-packer.8
fi
if ! test -s $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-unpacker.8 ; then
echo .so man8/cracklib-format.8 > $RPM_BUILD_ROOT/%{_mandir}/man8/cracklib-unpacker.8
if ! test -s %{buildroot}%{_mandir}/man8/cracklib-unpacker.8 ; then
echo .so man8/cracklib-format.8 > %{buildroot}%{_mandir}/man8/cracklib-unpacker.8
fi
%find_lang %{name}
%check
make test
# We want to check that the new library is able to open the new dictionaries,
# using the new python module.
LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} %{__python} 2>&1 << EOF
import string, sys
# Prepend buildroot-specific variations of the python path to the python path.
syspath2=[]
for element in sys.path:
syspath2.append("$RPM_BUILD_ROOT/" + element)
syspath2.reverse()
for element in syspath2:
sys.path.insert(0,element)
# Now actually do the test. If we get a different result, or throw an
# exception, the script will end with the error.
import cracklib
try:
s = cracklib.FascistCheck("cracklib", "$RPM_BUILD_ROOT/%{dictpath}")
except ValueError, message:
expected = "it is based on a dictionary word"
if message != expected:
print "Got unexpected result \"%s\"," % messgae,
print "instead of expected value of \"%s\"." % expected
sys.exit(1)
print "Got expected result \"%s\"," % message
sys.exit(0)
finally:
sys.exit(0)
EOF
make test DESTDIR=%{buildroot}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%triggerpostun -p /sbin/ldconfig -- cracklib < 2.7-24
%ldconfig_scriptlets
%files -f %{name}.lang
%defattr(-,root,root)
%doc README README-WORDS NEWS README-LICENSE AUTHORS
%{!?_licensedir:%global license %%doc}
%license COPYING.LIB
%{_libdir}/libcrack.so.*
%dir %{_datadir}/cracklib
@ -202,25 +143,128 @@ EOF
%{_mandir}/man8/*
%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/libcrack.so
%{_mandir}/man3/*
%files dicts
%defattr(-,root,root)
%{_datadir}/cracklib/pw_dict.*
%{_datadir}/cracklib/cracklib-small.*
%{_libdir}/cracklib_dict.*
%{_sbindir}/mkdict
%{_sbindir}/packer
%files python
%defattr(-,root,root)
%{_libdir}/python*/site-packages/_cracklib*.so
%{_libdir}/python*/site-packages/*.py*
%changelog
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.11-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.11-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.11-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Aug 04 2023 Dmitry Belyavskiy <dbelyavs@redhat.com> - 2.9.11-3
- migrated to SPDX license
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jul 07 2023 Paul Wouters <paul.wouters@aiven.io - 2.9.11-1
- Resolves: rhbz#2123955 cracklib-2.9.11 is available
- Remove old patches, port remaining patches to 2.9.11
- Use man pages from doc/ instead of pulling them from debian
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Aug 30 2022 Parag Nemade <pnemade AT redhat DOT com> - 2.9.7-30
- As -dicts subpackage installs files under %%{_libdir} path it should not be noarch
- this fixes FTBFS on F37+
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.7-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Aug 30 2021 Paul Wouters <paul.wouters@aiven.io> - 2.9.6-27
- Resolves: rhbz#1994196 Remove /usr/bin/packer symbolic link
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 2.9.6-23
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 9 2019 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-21
- Drop Python 2 bindings completely
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Nov 26 2018 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-18
- Fix regression in dictionary creation and lookup
* Wed Oct 10 2018 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-17
- Fix minor bug found in the Coverity scan
* Tue Oct 9 2018 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-16
- Updated translations
* Fri Jul 13 2018 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-15
- The test must use the dictionary from the build
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 21 2018 Tomáš Mráz <tmraz@redhat.com> - 2.9.6-13
- Drop Python 2 support in RHEL
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.9.6-11
- Switch to %%ldconfig_scriptlets
* Wed Jan 03 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.9.6-10
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.9.6-9
- Add Provides for the old name without %%_isa
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.9.6-8
- Python 2 binary package renamed to python2-cracklib
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Dec 8 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.6-4
- fix CVE-2016-6318 - avoid overflows in GECOS handling and mangling password (#1364944)

View file

@ -1,5 +1,3 @@
12936e97cc34a28f2efec62e115a60e1 cracklib2_2.8.19-1.debian.tar.gz
bf8714368e0a485472b6ad7c4dba06a3 cracklib2_2.8.19-1.dsc
c52f463585d85924b28cdc1e373ae06d cracklib-2.9.6.tar.gz
cae1257e3a9f95c917cc9dbbab852316 cracklib-words-2.9.6.gz
8405c72b4f68fe569da831abff4c0544 missing-words.gz
SHA512 (cracklib-2.9.11.tar.gz) = 9e73a715c8f82723abc36b08906e212aaf79a7f6dfa560c6a98963b1e63aa21f7b612f285a639a41ec9eec7025aa2c16f702aad934cd30bc995f470d62ee4bc3
SHA512 (cracklib-words-2.9.11.gz) = d1983e8e8fcb9abee4701581d66008eda2d7ad6ee8d017b7fed225b71bd333fa6199338f37fd120c1c6bf1c8a75025692f4118d97e8c384e578000bed59c6aed
SHA512 (missing-words.gz) = 50afb5538ddd15de997883f5ff6925d9084117851cfdcfc02f05c28304d6c17b46ea669fe626ad819e732b6f291f308194300c9db9b110a5c15a4e5d97ca6caa

View file

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/cracklib/Sanity/ABI-compatibility
# Description: Test if the ABI hasn't changed
# Author: Hubert Kario <hkario@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/cracklib/Sanity/ABI-compatibility
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Hubert Kario <hkario@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test if the ABI hasn't changed" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: cracklib" >> $(METADATA)
@echo "Requires: cracklib cracklib-devel gcc words ltrace" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL3 -RHEL4" >> $(METADATA)
rhts-lint $(METADATA)

View file

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/cracklib/Sanity/ABI-compatibility
Description: Test if the ABI hasn't changed
Author: Hubert Kario <hkario@redhat.com>

View file

@ -0,0 +1,81 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/cracklib/Sanity/ABI-compatibility
# Description: Test if the ABI hasn't changed
# Author: Hubert Kario <hkario@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2013 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="cracklib"
if rlIsRHEL 5; then
PACKAGES="cracklib gcc words ltrace"
else
PACKAGES="cracklib cracklib-devel gcc words ltrace"
fi
rlJournalStart
rlPhaseStartSetup
for PKG in $PACKAGES; do
rlAssertRpm $PKG
done
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "if [ ! -e /usr/share/cracklib/pw_dict.pwi ]; then create-cracklib-dict /usr/share/dict/words; fi" 0 "Create a cracklib dictionary if not already present"
rlRun "pushd $TmpDir"
rlRun "cat > test.c <<_EOF_
#include <stdio.h>
#include <crack.h>
int main(int argc, char **argv)
{
char const *dict = \"/usr/share/cracklib/pw_dict\";
char const *msg = NULL;
msg = FascistCheck(\"AAAAAAAA\", dict);
if (msg == 0)
return 1;
else
{
printf(\"%s\\n\", msg);
return 0;
}
}
_EOF_" 0 "Create test application"
rlPhaseEnd
rlPhaseStartTest
rlRun "gcc -O0 test.c -lcrack -Wall -o test" 0 "Compile the program"
rlRun "./test" 0 "Run the program"
rlRun "ltrace -o ltrace.out ./test" 0 "Run the program with ltrace"
rlRun "grep FascistCheck ltrace.out" 0 "Check if it actually uses the library function"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/cracklib/Sanity/Localization
# Description: Check if package localization is correct
# Author: Hubert Kario <hkario@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/cracklib/Sanity/Localization
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Hubert Kario <hkario@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Check if package localization is correct" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: cracklib" >> $(METADATA)
@echo "Requires: cracklib" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View file

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/cracklib/Sanity/Localization
Description: Check if package localization is correct
Author: Hubert Kario <hkario@redhat.com>

125
tests/Localization/runtest.sh Executable file
View file

@ -0,0 +1,125 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/cracklib/Sanity/Localization
# Description: Check if package localization is correct
# Author: Hubert Kario <hkario@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="cracklib"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlAssertRpm grep
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest "Sanity"
rlRun "echo 'aVk(|vDTRz$xVE-W6(Z2' | LANG=C cracklib-check | grep ': OK'" 0 "Check if cracklib-check accepts complex passwords"
rlRun "echo AAAAAAAAAAAA | LANG=C cracklib-check | grep ': OK'" 1 "Verify that cracklib-check rejects simple passwords"
rlRun "echo AAAAAAAAAAAA | LANG=C cracklib-check | grep 'DIFFERENT'" 0 "Verify that rejection message contains string 'DIFFERENT'"
rlPhaseEnd
NAME[0]="Assamese"
CODE[0]="as_IN.utf8"
NAME[1]="Bengali"
CODE[1]="bn_IN.utf8"
NAME[2]="German"
CODE[2]="de_DE.utf8"
NAME[3]="Spanish"
CODE[3]="es_ES.utf8"
NAME[4]="French"
CODE[4]="fr_FR.utf8"
NAME[5]="Gujarati"
CODE[5]="gu_IN.utf8"
NAME[6]="Hindi"
CODE[6]="hi_IN.utf8"
NAME[7]="Italian"
CODE[7]="it_IT.utf8"
NAME[8]="Japanese"
CODE[8]="ja_JP.utf8"
NAME[9]="Kannada"
CODE[9]="kn_IN.utf8"
NAME[10]="Korean"
CODE[10]="ko_KR.utf8"
NAME[11]="Malayalam"
CODE[11]="ml_IN.utf8"
NAME[12]="Marathi"
CODE[12]="mr_IN.utf8"
NAME[13]="Oriya"
CODE[13]="or_IN.utf8"
NAME[14]="Punjabi"
CODE[14]="pa_IN.utf8"
NAME[15]="Brazil Portugese"
CODE[15]="pt_BR.utf8"
NAME[16]="Russian"
CODE[16]="ru_RU.utf8"
NAME[17]="Tamil"
CODE[17]="ta_IN.utf8"
NAME[18]="Telugu"
CODE[18]="te_IN.utf8"
NAME[19]="Chinese"
CODE[19]="zh_CN.utf8"
NAME[20]="Taiwanese Chinese"
CODE[20]="zh_TW.utf8"
for i in ${!NAME[@]}; do
rlPhaseStartTest "${NAME[$i]}"
rlRun "echo AAAAAAAAAAAA | LANG=${CODE[$i]} cracklib-check | grep -Ev DIFFERENT\>" 0 "Check if fallback message isn't used"
rlRun "echo AAAAAAAAAAAA | LANG=${CODE[$i]} cracklib-check | grep '???????'" 1 "Check if message isn't clobbered"
rlPhaseEnd
done
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

3
tests/inventory Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
export TEST_DOCKER_EXTRA_ARGS="--security-opt seccomp:unconfined"
exec merge-standard-inventory "$@"

25
tests/tests.yml Normal file
View file

@ -0,0 +1,25 @@
---
# Tests for Docker and Classic Context
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
tests:
- ABI-compatibility
- Localization
required_packages:
- words # required for ABI-compatibility
- cracklib-devel # required for ABI-compatibility
- ltrace # required for ABI-compatibility
- gcc # required for ABI-compatibility
# Tests for Atomic
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- atomic
tests:
- Localization