41 |
#include "wptCardEdit.h" |
#include "wptCardEdit.h" |
42 |
#include "wptCrypto.h" |
#include "wptCrypto.h" |
43 |
|
|
44 |
|
void remove_crit_file_attrs (const char *fname, int force); |
45 |
|
|
46 |
|
|
47 |
HINSTANCE glob_hinst; /* global instance for the dialogs */ |
HINSTANCE glob_hinst; /* global instance for the dialogs */ |
48 |
HWND glob_hwnd; /* global window handle for the dialogs */ |
HWND glob_hwnd; /* global window handle for the dialogs */ |
134 |
} |
} |
135 |
|
|
136 |
|
|
137 |
|
/* Check gpg files if they are read-only and ask the user |
138 |
|
if this should be corrected. */ |
139 |
|
static void |
140 |
|
check_readonly_attr (const char *homedir) |
141 |
|
{ |
142 |
|
const char *files[] = {"pubring.gpg", "secring.gpg", "trustdb.gpg", NULL}; |
143 |
|
char *file; |
144 |
|
int i; |
145 |
|
|
146 |
|
for (i=0; files[i] != NULL; i++) { |
147 |
|
file = make_filename (homedir, files[i], NULL); |
148 |
|
remove_crit_file_attrs (file, 0); |
149 |
|
free_if_alloc (file); |
150 |
|
} |
151 |
|
} |
152 |
|
|
153 |
|
|
154 |
/* Load the GPG environment. On the first start, some |
/* Load the GPG environment. On the first start, some |
155 |
checks are performed to find out in what state GPG is. |
checks are performed to find out in what state GPG is. |
187 |
return (2); |
return (2); |
188 |
} |
} |
189 |
} |
} |
190 |
|
check_readonly_attr (p); |
191 |
pkr = make_filename (p, "pubring", "gpg"); |
pkr = make_filename (p, "pubring", "gpg"); |
192 |
free_if_alloc (p); |
free_if_alloc (p); |
193 |
if (!pkr) |
if (!pkr) |