]>
Commit | Line | Data |
---|---|---|
c0463006 JR |
1 | diff -urN john-1.6.orig/src/config.c john-1.6/src/config.c |
2 | --- john-1.6.orig/src/config.c Thu Dec 3 01:29:50 1998 | |
3 | +++ john-1.6/src/config.c Wed Dec 9 13:08:02 1998 | |
4 | @@ -7,6 +7,9 @@ | |
5 | #include <stdlib.h> | |
6 | #include <string.h> | |
7 | #include <ctype.h> | |
8 | +#include <pwd.h> | |
9 | +#include <sys/types.h> | |
10 | +#include <unistd.h> | |
11 | ||
12 | #include "misc.h" | |
13 | #include "params.h" | |
14 | @@ -117,11 +120,18 @@ | |
15 | FILE *file; | |
16 | char line[LINE_BUFFER_SIZE]; | |
17 | int number; | |
18 | + char name2[100]; | |
19 | + struct passwd *haslo; | |
20 | ||
21 | + haslo = getpwuid(getuid()); | |
22 | + sprintf(name2, "%s/.john.ini", haslo->pw_dir); | |
23 | if (cfg_database) return; | |
24 | - | |
25 | - if (!(file = fopen(path_expand(name), "r"))) | |
26 | - pexit("fopen: %s", path_expand(name)); | |
27 | + | |
28 | + if (!(file = fopen(name2, "r"))) | |
29 | + { | |
30 | + if (!(file = fopen(path_expand(name), "r"))) | |
31 | + pexit("fopen: ~/.john.ini or %s", path_expand(name)); | |
32 | + } | |
33 | ||
34 | number = 0; | |
35 | while (fgetl(line, sizeof(line), file)) |