chiark / gitweb /
journal: set secure deletion flags for FSS file
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Aug 2012 20:10:11 +0000 (22:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Aug 2012 20:10:11 +0000 (22:10 +0200)
TODO
src/journal/journalctl.c

diff --git a/TODO b/TODO
index 102a8138b995a6cee8179e5920990df2b58f24d3..875a3db4d6acab36bfa0ed578a19e7595b3ec7d2 100644 (file)
--- 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
index 5c21ab0adffd7dbeaf50041da32787b26b3ff797..25f41f63222230f06b36312c79382020592368f4 100644 (file)
@@ -30,6 +30,8 @@
 #include <time.h>
 #include <getopt.h>
 #include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <linux/fs.h>
 
 #include <systemd/sd-journal.h>
 
@@ -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;