From 4f2c1e32cfe0ebcb628c5a55a52eef283aa39446 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Wed, 5 Oct 2016 01:10:52 -0600 Subject: * When Alpine is compiled with password file and SMIME support the password file is encrypted using a private key/public certificate pair. If one such pair cannot be found, one will be created. --- pith/readfile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pith/readfile.c') diff --git a/pith/readfile.c b/pith/readfile.c index cae03fc1..e918ec99 100644 --- a/pith/readfile.c +++ b/pith/readfile.c @@ -78,6 +78,7 @@ our_copy(char *to_file, char *from_file) { STORE_S *in_cert, *out_cert; unsigned char c; + long int size = 0; in_cert = so_get(FileStar, from_file, READ_ACCESS | READ_FROM_LOCALE); if (in_cert == NULL) @@ -89,9 +90,14 @@ our_copy(char *to_file, char *from_file) return -1; } - while(so_readc(&c, in_cert) > 0) - so_writec(c, out_cert); + so_seek(out_cert, 0L, 0); + so_truncate(out_cert, 0); + while(so_readc(&c, in_cert) > 0){ + so_writec(c, out_cert); +// size++; + } +// so_truncate(out_cert, size); so_give(&in_cert); so_give(&out_cert); -- cgit v1.2.3-54-g00ecf