~ubuntu-branches/debian/lenny/cracklib2/lenny

« back to all changes in this revision

Viewing changes to debian/patches/09-multidicts.patch

  • Committer: Bazaar Package Importer
  • Author(s): Jan Dittberner, Steve Langasek, Jan Dittberner
  • Date: 2008-10-16 21:04:24 UTC
  • mfrom: (4.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081016210424-bp06uo8c6xkjabzi
Tags: 2.8.12-8lenny1
[ Steve Langasek ]
* debian/update-cracklib: don't rely on [ -nt ] to return true when
  the second file is non-existent, since this fails under dash.
  LP: #278743.

[ Jan Dittberner ]
* integrate Ubuntu bugfix
* use set -e in debian/cracklib-runtime.preinst to fix lintian warning
  maintainer-script-ignores-errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- cracklib2-2.7.orig/cracklib/packlib.c
2
 
+++ cracklib2-2.7/cracklib/packlib.c
3
 
@@ -11,8 +11,9 @@
4
 
 
5
 
 static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
6
 
 
7
 
-/* PWClose() already needs this, so forward-declare it */
8
 
+/* PWClose() already needs these, so forward-declare them */
9
 
 int PutPW(PWDICT* pwp, char* string);
10
 
+char * GetPW(PWDICT* pwp, int32 number);
11
 
 
12
 
 PWDICT *
13
 
 PWOpen(char const prefix[], char const mode[])
14
 
@@ -158,9 +159,16 @@
15
 
 
16
 
     fclose(pwp->ifp);
17
 
     fclose(pwp->dfp);
18
 
+    if (pwp->flags & PFOR_USEHWMS)
19
 
+    {
20
 
+       fclose(pwp->wfp);
21
 
+    }
22
 
 
23
 
     pwp->header.pih_magic = 0;
24
 
 
25
 
+    /* reset the static prevblock */
26
 
+    GetPW(NULL, 0);
27
 
+
28
 
     return (0);
29
 
 }
30
 
 
31
 
@@ -238,6 +246,13 @@
32
 
     static int32 prevblock = 0xffffffff;
33
 
     int32 thisblock;
34
 
 
35
 
+    if (pwp == NULL)
36
 
+    {
37
 
+       /* we need to reset prevblock when we close our dictionary file */
38
 
+       prevblock = 0xffffffff;
39
 
+       return ((char *) 0);
40
 
+    }
41
 
+
42
 
     thisblock = number / NUMWORDS;
43
 
 
44
 
     if (prevblock == thisblock)