diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-07-03 12:07:54 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-07-03 12:07:54 -0600 |
commit | f720e89f631da58c355ead60b35225e43d0d9d33 (patch) | |
tree | 5b715785837e912a0c784bbfe78f394db5e5454a /alpine/imap.c | |
parent | f6a3f80237f4b565e97aa72130444d8262c723b8 (diff) | |
download | alpine-f720e89f631da58c355ead60b35225e43d0d9d33.tar.xz |
* When Alpine is built without smime, password file functionality
might fail. Reported by Andres Fehr.
Diffstat (limited to 'alpine/imap.c')
-rw-r--r-- | alpine/imap.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/alpine/imap.c b/alpine/imap.c index bd15b268..e9e16000 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -3192,6 +3192,7 @@ read_passfile(pinerc, l) int i, j, n, rv = 0; size_t len; char *tmptext = NULL; + struct stat sbuf; #ifdef SMIME char tmp2[MAILTMPLEN]; char *text = NULL, *text2 = NULL; @@ -3210,7 +3211,13 @@ read_passfile(pinerc, l) return(using_passfile); }; -#ifdef SMIME +#ifndef SMIME + if(our_stat(tmp, &sbuf) == 0) + len = sbuf.st_size; + else + len = 0; + fp = our_fopen(tmp, "rb"); /* reopen to read data */ +#else /* the next call initializes the key/certificate pair used to * encrypt and decrypt a password file. The details of how this is * done is in the file pith/smime.c. During this setup we might call @@ -3295,14 +3302,6 @@ read_passfile(pinerc, l) default: break; } } - else{ - struct stat sbuf; - if(our_stat(tmp, &sbuf) == 0) - len = sbuf.st_size; - else - len = 0; - fp = our_fopen(tmp, "rb"); /* reopen to read data */ - } #endif /* SMIME */ if(using_passfile == 0){ |