diff options
author | Eduardo Chappa <chappa@washington.edu> | 2016-05-30 07:43:40 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2016-05-30 07:43:40 -0600 |
commit | ac3d691ed77f2c71e986d618f1fe93a69ee74b54 (patch) | |
tree | 8a395b536402b55b22843de440f1399ed1d573dc | |
parent | 9abb6857918960af55433274d71829832a74a47d (diff) | |
download | alpine-ac3d691ed77f2c71e986d618f1fe93a69ee74b54.tar.xz |
* With the change in logic in the way passwords are saved we need to
check if the password file exists before we ask the user if we
want to preserve the password for the next login.
-rw-r--r-- | alpine/imap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/alpine/imap.c b/alpine/imap.c index b853285e..608e6fbf 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -104,7 +104,7 @@ int answer_cert_failure(int, MSGNO_S *, SCROLL_S *); #ifdef LOCAL_PASSWD_CACHE int read_passfile(char *, MMLOGIN_S **); void write_passfile(char *, MMLOGIN_S *); -int preserve_prompt(void); +int preserve_prompt(char *); void update_passfile_hostlist(char *, char *, STRLIST_S *, int); static MMLOGIN_S *passfile_cache = NULL; @@ -2696,7 +2696,7 @@ get_passfile_user(pinerc, hostlist) int -preserve_prompt(void) +preserve_prompt(char *pinerc) { #ifdef WINCRED # if (WINCRED > 0) @@ -2741,6 +2741,12 @@ preserve_prompt(void) } return(0); #else /* PASSFILE */ + char tmp[MAILTMPLEN]; + struct stat sbuf; + + if(!passfile_name(pinerc, tmp, sizeof(tmp)) || our_stat(tmp, &sbuf) < 0) + return 0; + if(F_OFF(F_DISABLE_PASSWORD_FILE_SAVING,ps_global)) return(want_to(_("Preserve password on DISK for next login"), 'y', 'x', NO_HELP, WT_NORM) @@ -2885,7 +2891,7 @@ set_passfile_passwd(pinerc, passwd, user, hostlist, altflag, already_prompted) int altflag, already_prompted; { dprint((10, "set_passfile_passwd\n")); - if(((already_prompted == 0 && preserve_prompt()) + if(((already_prompted == 0 && preserve_prompt(pinerc)) || already_prompted == 1) && !ps_global->nowrite_password_cache && (passfile_cache || read_passfile(pinerc, &passfile_cache))){ |