[systemd-commits] TODO src/journal src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Mon Jul 9 08:30:48 PDT 2012


 TODO                   |    4 ++++
 src/journal/journald.c |    2 +-
 src/shared/util.c      |    3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 461b1822321d6be0d7fd8be29bf3b4993ebd1b85
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Jul 9 17:30:22 2012 +0200

    paranoia: refuse rm_rf("/")

diff --git a/TODO b/TODO
index 5efd11b..dde1b90 100644
--- a/TODO
+++ b/TODO
@@ -22,6 +22,10 @@ Bugfixes:
 
 Features:
 
+* refuse taking lower-case variable names in sd_journal_send() and friends.
+
+* when running as user instance: implicitly default to WorkingDirectory=$HOME for all services.
+
 * journalctl highlight reboots
 
 * Merge KillUnit()'s mode and who params into one
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 8d1b10d..0629f79 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -2058,7 +2058,6 @@ static int system_journal_open(Server *s) {
 }
 
 static int server_flush_to_var(Server *s) {
-        char path[] = "/run/log/journal/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
         Object *o = NULL;
         int r;
         sd_id128_t machine;
@@ -2135,6 +2134,7 @@ finish:
         s->runtime_journal = NULL;
 
         if (r >= 0) {
+                char path[] = "/run/log/journal/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
                 sd_id128_to_string(machine, path + 17);
                 rm_rf(path, false, true, false);
         }
diff --git a/src/shared/util.c b/src/shared/util.c
index 041a63b..41505b2 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3339,6 +3339,9 @@ int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky
 
         assert(path);
 
+        /* Be paranoid */
+        assert(!streq(path, "/"));
+
         fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
         if (fd < 0) {
 



More information about the systemd-commits mailing list