Truncate password file after zeroing.

This commit is contained in:
Moinak Ghosh 2013-08-29 22:03:08 +05:30
parent 9a7a8e84fe
commit 2e62be3c9c

View file

@ -863,7 +863,7 @@ start_decompress(pc_ctx_t *pctx, const char *filename, const char *to_filename)
} }
/* /*
* Archives older than 5 did not support MACs. * Archives older than version 5 did not support MACs.
*/ */
if (version < 5) if (version < 5)
pctx->mac_bytes = 0; pctx->mac_bytes = 0;
@ -988,6 +988,8 @@ start_decompress(pc_ctx_t *pctx, const char *filename, const char *to_filename)
pw[pw_len-1] = '\0'; pw[pw_len-1] = '\0';
lseek(fd, 0, SEEK_SET); lseek(fd, 0, SEEK_SET);
Write(fd, zero, pw_len); Write(fd, zero, pw_len);
len = ftruncate(fd, 0);
/*^^^ Make compiler happy. */
} else { } else {
pw_len = -1; pw_len = -1;
} }