diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 28 |
1 files changed, 28 insertions, 0 deletions
| @@ -87,6 +87,7 @@ | |||
| 87 | #include "foldersel.h" | 87 | #include "foldersel.h" |
| 88 | #include "update_check.h" | 88 | #include "update_check.h" |
| 89 | #include "colorlabel.h" | 89 | #include "colorlabel.h" |
| 90 | #include "masterpassword.h" | ||
| 90 | 91 | ||
| 91 | #if USE_GPGME | 92 | #if USE_GPGME |
| 92 | # include "rfc2015.h" | 93 | # include "rfc2015.h" |
| @@ -275,6 +276,32 @@ int main(int argc, char *argv[]) | |||
| 275 | CHDIR_EXIT_IF_FAIL(get_home_dir(), 1); | 276 | CHDIR_EXIT_IF_FAIL(get_home_dir(), 1); |
| 276 | 277 | ||
| 277 | prefs_common_read_config(); | 278 | prefs_common_read_config(); |
| 279 | set_master_password(NULL); | ||
| 280 | #if USE_SSL | ||
| 281 | if (prefs_common.use_master_password) { | ||
| 282 | if (prefs_common.master_password_hash != NULL) { | ||
| 283 | if (check_master_password_interactively(3)) { | ||
| 284 | if (alertpanel(_("Master password"), | ||
| 285 | _("Unable to set master password"), | ||
| 286 | GTK_STOCK_DISCARD, | ||
| 287 | GTK_STOCK_QUIT, | ||
| 288 | NULL) != G_ALERTDEFAULT) { | ||
| 289 | exit(1); | ||
| 290 | } | ||
| 291 | } | ||
| 292 | } else { | ||
| 293 | if (set_master_password_interactively(3) != 0) { | ||
| 294 | if (alertpanel(_("Master password"), | ||
| 295 | _("Unable to set master password"), | ||
| 296 | GTK_STOCK_DISCARD, | ||
| 297 | GTK_STOCK_QUIT, | ||
| 298 | NULL) != G_ALERTDEFAULT) { | ||
| 299 | exit(1); | ||
| 300 | } | ||
| 301 | } | ||
| 302 | } | ||
| 303 | } | ||
| 304 | #endif | ||
| 278 | filter_set_addressbook_func(addressbook_has_address); | 305 | filter_set_addressbook_func(addressbook_has_address); |
| 279 | filter_read_config(); | 306 | filter_read_config(); |
| 280 | prefs_actions_read_config(); | 307 | prefs_actions_read_config(); |
| @@ -995,6 +1022,7 @@ void app_will_exit(gboolean force) | |||
| 995 | 1022 | ||
| 996 | /* remove temporary files, close log file, socket cleanup */ | 1023 | /* remove temporary files, close log file, socket cleanup */ |
| 997 | #if USE_SSL | 1024 | #if USE_SSL |
| 1025 | unload_master_password(); | ||
| 998 | ssl_done(); | 1026 | ssl_done(); |
| 999 | #endif | 1027 | #endif |
| 1000 | syl_cleanup(); | 1028 | syl_cleanup(); |
