This commit is contained in:
parent
1e72995350
commit
7c8bf468df
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:04e91632488fdc86e93d49fabd39e7b3f43b8cf4b5df01b9fc030672603f76b0
|
||||
size 502377
|
3
cracklib-2.8.13.tar.bz2
Normal file
3
cracklib-2.8.13.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5504233e3ae2ddfb28bc91e26214c880048d655c3914ef1bc3f4a5bbf8fbf455
|
||||
size 507797
|
@ -1,239 +0,0 @@
|
||||
Index: cracklib-2.8.12/lib/packlib.c
|
||||
===================================================================
|
||||
--- cracklib-2.8.12.orig/lib/packlib.c
|
||||
+++ cracklib-2.8.12/lib/packlib.c
|
||||
@@ -7,6 +7,9 @@
|
||||
#include "config.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+#include <zlib.h>
|
||||
+#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
@@ -82,15 +85,46 @@ PWOpen(prefix, mode)
|
||||
snprintf(dname, STRINGSIZE, "%s.pwd", prefix);
|
||||
snprintf(wname, STRINGSIZE, "%s.hwm", prefix);
|
||||
|
||||
- if (!(pdesc.dfp = fopen(dname, mode)))
|
||||
+ if (mode[0] == 'r')
|
||||
{
|
||||
- perror(dname);
|
||||
- return ((PWDICT *) 0);
|
||||
- }
|
||||
+ pdesc.flags &= ~PFOR_USEZLIB;
|
||||
+ /* first try the normal db file */
|
||||
+ if (!(pdesc.dfp = fopen(dname, mode)))
|
||||
+ {
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ pdesc.flags |= PFOR_USEZLIB;
|
||||
+ /* try extension .gz */
|
||||
+ snprintf(dname, STRINGSIZE, "%s.pwd.gz", prefix);
|
||||
+ if (!(pdesc.dfp = gzopen(dname, mode)))
|
||||
+ {
|
||||
+ perror(dname);
|
||||
+ return ((PWDICT *) 0);
|
||||
+ }
|
||||
+#else
|
||||
+ perror(dname);
|
||||
+ return ((PWDICT *) 0);
|
||||
+#endif
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ pdesc.flags &= ~PFOR_USEZLIB;
|
||||
+ /* write mode: use fopen */
|
||||
+ if (!(pdesc.dfp = fopen(dname, mode)))
|
||||
+ {
|
||||
+ perror(dname);
|
||||
+ return ((PWDICT *) 0);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (!(pdesc.ifp = fopen(iname, mode)))
|
||||
{
|
||||
- fclose(pdesc.dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(pdesc.dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(pdesc.dfp);
|
||||
perror(iname);
|
||||
return ((PWDICT *) 0);
|
||||
}
|
||||
@@ -122,7 +156,12 @@ PWOpen(prefix, mode)
|
||||
|
||||
pdesc.header.pih_magic = 0;
|
||||
fclose(ifp);
|
||||
- fclose(dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(dfp);
|
||||
if(wfp)
|
||||
{
|
||||
fclose(wfp);
|
||||
@@ -140,7 +179,12 @@ PWOpen(prefix, mode)
|
||||
|
||||
pdesc.header.pih_magic = 0;
|
||||
fclose(ifp);
|
||||
- fclose(dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(dfp);
|
||||
if(wfp)
|
||||
{
|
||||
fclose(wfp);
|
||||
@@ -154,7 +198,13 @@ PWOpen(prefix, mode)
|
||||
|
||||
pdesc.header.pih_magic = 0;
|
||||
fclose(ifp);
|
||||
- fclose(dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(dfp);
|
||||
+
|
||||
if(wfp)
|
||||
{
|
||||
fclose(wfp);
|
||||
@@ -174,7 +224,13 @@ PWOpen(prefix, mode)
|
||||
|
||||
pdesc.header.pih_magic = 0;
|
||||
fclose(ifp);
|
||||
- fclose(dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(dfp);
|
||||
+
|
||||
if(wfp)
|
||||
{
|
||||
fclose(wfp);
|
||||
@@ -188,7 +244,12 @@ PWOpen(prefix, mode)
|
||||
|
||||
pdesc.header.pih_magic = 0;
|
||||
fclose(ifp);
|
||||
- fclose(dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(dfp);
|
||||
if(wfp)
|
||||
{
|
||||
fclose(wfp);
|
||||
@@ -202,8 +263,13 @@ PWOpen(prefix, mode)
|
||||
|
||||
pdesc.header.pih_magic = 0;
|
||||
fclose(ifp);
|
||||
- fclose(dfp);
|
||||
- if(wfp)
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pdesc.flags & PFOR_USEZLIB)
|
||||
+ gzclose(dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(dfp);
|
||||
+ if(wfp)
|
||||
{
|
||||
fclose(wfp);
|
||||
}
|
||||
@@ -286,7 +352,12 @@ PWClose(pwp)
|
||||
}
|
||||
|
||||
fclose(pwp->ifp);
|
||||
- fclose(pwp->dfp);
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if(pwp->flags & PFOR_USEZLIB)
|
||||
+ gzclose(pwp->dfp);
|
||||
+ else
|
||||
+#endif
|
||||
+ fclose(pwp->dfp);
|
||||
if(pwp->wfp)
|
||||
{
|
||||
fclose(pwp->wfp);
|
||||
@@ -414,13 +485,40 @@ GetPW(pwp, number)
|
||||
}
|
||||
}
|
||||
|
||||
- if (fseek(pwp->dfp, datum, 0))
|
||||
+ int r = 1;
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if (pwp->flags & PFOR_USEZLIB)
|
||||
+ {
|
||||
+ r = gzseek(pwp->dfp, datum, 0);
|
||||
+ if(r >= 0)
|
||||
+ r = 0;
|
||||
+ }
|
||||
+ else
|
||||
+#endif
|
||||
+ r = fseek(pwp->dfp, datum, 0);
|
||||
+
|
||||
+
|
||||
+ if (r)
|
||||
{
|
||||
perror("(data fseek failed)");
|
||||
return ((char *) 0);
|
||||
}
|
||||
-
|
||||
- if (!fread(buffer, 1, sizeof(buffer), pwp->dfp))
|
||||
+ r = 0;
|
||||
+
|
||||
+#ifdef HAVE_ZLIB_H
|
||||
+ if (pwp->flags & PFOR_USEZLIB)
|
||||
+ {
|
||||
+ r = gzread(pwp->dfp, buffer, sizeof(buffer));
|
||||
+ if(r < 0)
|
||||
+ r = 0;
|
||||
+ }
|
||||
+ else
|
||||
+#endif
|
||||
+ r = fread(buffer, 1, sizeof(buffer), pwp->dfp);
|
||||
+
|
||||
+
|
||||
+
|
||||
+ if (!r)
|
||||
{
|
||||
perror("(data fread failed)");
|
||||
return ((char *) 0);
|
||||
Index: cracklib-2.8.12/configure.in
|
||||
===================================================================
|
||||
--- cracklib-2.8.12.orig/configure.in
|
||||
+++ cracklib-2.8.12/configure.in
|
||||
@@ -22,6 +22,9 @@ AC_CHECK_HEADERS(fcntl.h)
|
||||
AC_CHECK_HEADERS(inttypes.h)
|
||||
AC_CHECK_HEADERS(stdint.h)
|
||||
AC_CHECK_HEADERS(pthread.h)
|
||||
+AC_CHECK_HEADERS(zlib.h, AC_DEFINE(HAVE_ZLIB_H, [], [found zlib]))
|
||||
+
|
||||
+AC_SEARCH_LIBS(gzopen, z)
|
||||
|
||||
dnl Cygwin workaround
|
||||
AC_MSG_CHECKING(if LINE_MAX is defined)
|
||||
Index: cracklib-2.8.12/lib/packer.h
|
||||
===================================================================
|
||||
--- cracklib-2.8.12.orig/lib/packer.h
|
||||
+++ cracklib-2.8.12/lib/packer.h
|
||||
@@ -61,6 +61,8 @@ typedef struct
|
||||
#define PFOR_FLUSH 0x0002
|
||||
#define PFOR_USEHWMS 0x0004
|
||||
|
||||
+#define PFOR_USEZLIB 0x0008
|
||||
+
|
||||
uint32_t hwms[256];
|
||||
|
||||
struct pi_header header;
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed May 20 13:17:17 CEST 2009 - mc@suse.de
|
||||
|
||||
- update to version 2.8.13
|
||||
* Compressed dictionary support and better python module
|
||||
- remove zlib patch which is now upstream.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Apr 4 20:58:08 CEST 2009 - crrodriguez@suse.de
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package cracklib (Version 2.8.12)
|
||||
# spec file for package cracklib (Version 2.8.13)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -29,8 +29,8 @@ AutoReqProv: on
|
||||
Obsoletes: cracklib-64bit
|
||||
%endif
|
||||
#
|
||||
Version: 2.8.12
|
||||
Release: 58
|
||||
Version: 2.8.13
|
||||
Release: 1
|
||||
Requires: cracklib-dict
|
||||
Summary: Full Dictionary for cracklib
|
||||
Source: http://prdownloads.sourceforge.net/cracklib/cracklib-%{version}.tar.bz2
|
||||
@ -38,7 +38,6 @@ Source1: cracklib-po.tar.gz
|
||||
Patch: cracklib-magic.diff
|
||||
Patch1: cracklib-trans.diff
|
||||
Patch2: datarootdir.patch
|
||||
Patch3: cracklib-zlib.dif
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -87,7 +86,6 @@ This package contains a small dictionay file used by cracklib.
|
||||
%patch
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3 -p1
|
||||
|
||||
%build
|
||||
AUTOPOINT=true autoreconf -fi
|
||||
@ -158,6 +156,10 @@ ln -sf %{_datadir}/cracklib/pw_dict.pwi $RPM_BUILD_ROOT/usr/lib/cracklib_dict.pw
|
||||
%{_datadir}/cracklib/pw_dict.pwi
|
||||
|
||||
%changelog
|
||||
* Wed May 20 2009 mc@suse.de
|
||||
- update to version 2.8.13
|
||||
* Compressed dictionary support and better python module
|
||||
- remove zlib patch which is now upstream.
|
||||
* Sat Apr 04 2009 crrodriguez@suse.de
|
||||
- remove static libraries
|
||||
* Wed Feb 04 2009 mc@suse.de
|
||||
|
Loading…
x
Reference in New Issue
Block a user