2
* Present statistics on encrypted eCryptfs file attributes
11
#include "../include/ecryptfs.h"
13
static void usage(const char *filename)
16
"%s <filename>\n", filename);
19
int main(int argc, const char *argv[])
24
struct ecryptfs_crypt_stat_user crypt_stat;
33
fd = open(filename, O_RDONLY);
35
printf("Error opening file [%s] for RD_ONLY access; errno msg "
36
"= [%m]\n", filename, errno);
40
quant_read = read(fd, buf, 4096);
41
if (quant_read == -1) {
42
printf("Error attempting to read from file [%s]; errno msg "
43
"= [%m]\n", filename, errno);
47
rc = ecryptfs_parse_stat(&crypt_stat, buf, quant_read);
49
printf("Valid eCryptfs metadata information not found in [%s]"
54
printf("Decrypted file size: [%llu]\n", crypt_stat.file_size);