diff options
author | Eduardo Chappa <chappa@washington.edu> | 2014-04-08 23:57:49 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2014-04-08 23:57:49 -0600 |
commit | 7d34d6b88a46a8cf950dc6305fa3c781edd9d4f7 (patch) | |
tree | abcec7bc059644ca5ed9322e6bb1dda09743eccc /pith/readfile.c | |
parent | 6a18937898292e97c15289e5ecd5d8f1c2205110 (diff) | |
download | alpine-7d34d6b88a46a8cf950dc6305fa3c781edd9d4f7.tar.xz |
* Fixes bug in 2.19.8 that would make Alpine fail to build in Windows.
* S/MIME configuration screen would deinitialize smime, not allowing
it to send encrypted or signed messages.
* Add documentation for /loser option in definition of external servers.
* crashing bug in certificate management screen due to a BIO_free() call
of memory that had not been allocated.
* When the password file is decrypted, smime is inited. If smime is inited
before the .pinerc is read, some values might not be correctly set.
* When a password file exists, and S/MIME is enabled, encrypt it by either
using an existing key/certificate pair. The key is saved separately
in ~/.alpine-smime/.pwd, or in the directory specified by the
-pwdcertdir command line option.
Diffstat (limited to 'pith/readfile.c')
-rw-r--r-- | pith/readfile.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pith/readfile.c b/pith/readfile.c index 4fc9fa3e..cae03fc1 100644 --- a/pith/readfile.c +++ b/pith/readfile.c @@ -69,3 +69,31 @@ read_file(char *filename, int so_get_flags) return(return_text); } + +/* our copy, to_file and from_file must be full paths. from_file + * must exist. + */ +int +our_copy(char *to_file, char *from_file) +{ + STORE_S *in_cert, *out_cert; + unsigned char c; + + in_cert = so_get(FileStar, from_file, READ_ACCESS | READ_FROM_LOCALE); + if (in_cert == NULL) + return -1; + + out_cert = so_get(FileStar, to_file, WRITE_ACCESS | WRITE_TO_LOCALE); + if (out_cert == NULL){ + so_give(&in_cert); + return -1; + } + + while(so_readc(&c, in_cert) > 0) + so_writec(c, out_cert); + + so_give(&in_cert); + so_give(&out_cert); + + return 0; +} |