1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
--- cracklib2-2.7.orig/util/packer.c
+++ cracklib2-2.7/util/packer.c
@@ -8,6 +8,9 @@
#include "packer.h"
+char* Chop(char*);
+int PutPW(PWDICT*, char*);
+
int
main(argc, argv)
int argc;
--- cracklib2-2.7.orig/util/unpacker.c
+++ cracklib2-2.7/util/unpacker.c
@@ -8,6 +8,8 @@
#include "packer.h"
+char* GetPW(PWDICT*, int32);
+
int
main(argc, argv)
int argc;
@@ -15,7 +17,6 @@
{
int32 i;
PWDICT *pwp;
- char buffer[STRINGSIZE];
if (argc <= 1)
{
--- cracklib2-2.7.orig/util/testlib.c
+++ cracklib2-2.7/util/testlib.c
@@ -6,12 +6,14 @@
* and upwards.
*/
+#include "crack.h"
#include "packer.h"
+char Chop( char* );
+
int
main ()
{
- int32 i;
char buffer[STRINGSIZE];
printf("enter potential passwords, one per line...\n");
--- cracklib2-2.7.orig/util/testnum.c
+++ cracklib2-2.7/util/testnum.c
@@ -6,8 +6,11 @@
* and upwards.
*/
+#include "crack.h"
#include "packer.h"
+char* GetPW(PWDICT*, int32 );
+
int
main ()
{
--- cracklib2-2.7.orig/util/teststr.c
+++ cracklib2-2.7/util/teststr.c
@@ -6,12 +6,14 @@
* and upwards.
*/
+#include "crack.h"
#include "packer.h"
+char Chop( char* );
+
int
main ()
{
- int32 i;
PWDICT *pwp;
char buffer[STRINGSIZE];
--- cracklib2-2.7.orig/cracklib/packer.h
+++ cracklib2-2.7/cracklib/packer.h
@@ -51,10 +50,14 @@
#define PW_WORDS(x) ((x)->header.pih_numwords)
#define PIH_MAGIC 0x70775631
+extern int32 FindPW(PWDICT * pwp, char * string);
+extern int PWClose(PWDICT * pwp);
+extern char * Trim(char * string);
+extern int PMatch(register char *control, register char *string);
-extern PWDICT *PWOpen();
+
+extern PWDICT * PWOpen(char const prefix[], char const mode[]);
-extern char *Mangle();
+extern char *Mangle(char* input, char* control);
-extern char *FascistCheck();
#define CRACK_TOLOWER(a) (isupper(a)?tolower(a):(a))
#define CRACK_TOUPPER(a) (islower(a)?toupper(a):(a))
--- cracklib2-2.7.orig/cracklib/fascist.c
+++ cracklib2-2.7/cracklib/fascist.c
@@ -8,10 +8,15 @@
static char vers_id[] = "fascist.c : v2.3p3 Alec Muffett 14 dec 1997";
+#include "crack.h"
#include "packer.h"
#include <sys/types.h>
#include <pwd.h>
+#include <string.h>
+#include <stdlib.h> /* exit() */
+#include <unistd.h>
+
#define ISSKIP(x) (isspace(x) || ispunct(x))
#define MINDIFF 5
@@ -744,10 +749,7 @@
return ((char *) 0);
}
-char *
-FascistCheck(password, path)
- char *password;
- char *path;
+char const * FascistCheck(char const password[], char const path[])
{
static char lastpath[STRINGSIZE];
static PWDICT *pwp;
--- cracklib2-2.7.orig/cracklib/rules.c
+++ cracklib2-2.7/cracklib/rules.c
@@ -16,6 +16,8 @@
#include "packer.h"
+#include <string.h> /* strlen(), strcpy() */
+
static void
Debug(val, a, b, c, d, e, f, g)
int val;
--- cracklib2-2.7.orig/cracklib/stringlib.c
+++ cracklib2-2.7/cracklib/stringlib.c
@@ -8,6 +8,9 @@
#include "packer.h"
+#include <string.h> /* strcpy(), strlen() */
+#include <stdlib.h> /* malloc() */
+
static char vers_id[] = "stringlib.c : v2.3p2 Alec Muffett 18 May 1993";
char
--- cracklib2-2.7.orig/cracklib/packlib.c
+++ cracklib2-2.7/cracklib/packlib.c
@@ -7,20 +7,20 @@
*/
#include "packer.h"
+#include <string.h> /* memset(), strncpy(), strcpy(), strcmp() */
static char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
+/* PWClose() already needs this, so forward-declare it */
+int PutPW(PWDICT* pwp, char* string);
+
PWDICT *
-PWOpen(prefix, mode)
- char *prefix;
- char *mode;
+PWOpen(char const prefix[], char const mode[])
{
- int32 i;
static PWDICT pdesc;
char iname[STRINGSIZE];
char dname[STRINGSIZE];
char wname[STRINGSIZE];
- char buffer[STRINGSIZE];
FILE *dfp;
FILE *ifp;
FILE *wfp;
@@ -114,8 +114,7 @@
}
int
-PWClose(pwp)
- PWDICT *pwp;
+PWClose(PWDICT *pwp)
{
if (pwp->header.pih_magic != PIH_MAGIC)
{
@@ -166,9 +165,7 @@
}
int
-PutPW(pwp, string)
- PWDICT *pwp;
- char *string;
+PutPW(PWDICT* pwp, char* string)
{
if (!(pwp->flags & PFOR_WRITE))
{
@@ -229,9 +226,7 @@
}
char *
-GetPW(pwp, number)
- PWDICT *pwp;
- int32 number;
+GetPW(PWDICT* pwp, int32 number)
{
int32 datum;
register int i;
@@ -297,9 +292,7 @@
}
int32
-FindPW(pwp, string)
- PWDICT *pwp;
- char *string;
+FindPW(PWDICT* pwp, char* string)
{
register int32 lwm;
register int32 hwm;
|