From: Lennart Poettering Date: Fri, 17 Aug 2012 20:10:11 +0000 (+0200) Subject: journal: set secure deletion flags for FSS file X-Git-Tag: v189~50 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=f982e6f7612401a9a789bb8f40d2adca34c85c10 journal: set secure deletion flags for FSS file --- diff --git a/TODO b/TODO index 102a8138b..875a3db4d 100644 --- a/TODO +++ b/TODO @@ -49,6 +49,8 @@ Bugfixes: Features: +* man: document in ExecStart= explicitly that we don't take shell command lines, only executable names with arguments + * shutdown: don't read-only mount anything when running in container * nspawn: --read-only is not applied recursively to submounts diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 5c21ab0ad..25f41f632 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include @@ -453,7 +455,7 @@ static int setup_keys(void) { size_t mpk_size, seed_size, state_size, i; uint8_t *mpk, *seed, *state; ssize_t l; - int fd = -1, r; + int fd = -1, r, attr = 0; sd_id128_t machine, boot; char *p = NULL, *k = NULL; struct FSSHeader h; @@ -530,6 +532,16 @@ static int setup_keys(void) { goto finish; } + /* Enable secure remove, exclusion from dump, synchronous + * writing and in-place updating */ + if (ioctl(fd, FS_IOC_GETFLAGS, &attr) < 0) + log_warning("FS_IOC_GETFLAGS failed: %m"); + + attr |= FS_SECRM_FL|FS_NODUMP_FL|FS_SYNC_FL|FS_NOCOW_FL; + + if (ioctl(fd, FS_IOC_SETFLAGS, &attr) < 0) + log_warning("FS_IOC_SETFLAGS failed: %m"); + zero(h); memcpy(h.signature, "KSHHRHLP", 8); h.machine_id = machine;