[systemd-commits] 2 commits - TODO src/core

Lennart Poettering lennart at kemper.freedesktop.org
Mon Oct 22 16:57:49 PDT 2012


 TODO             |    2 ++
 src/core/mount.c |   16 ++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 603cd8fe07cb03e8b11722d1a732e569e5a46347
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Oct 23 01:53:23 2012 +0200

    update TODO

diff --git a/TODO b/TODO
index 0b5d74d..bdd2d43 100644
--- a/TODO
+++ b/TODO
@@ -19,6 +19,8 @@ F18:
 
 Features:
 
+* add --unit to systemctl switch-root somehow
+
 * journalctl/gatewayd: GELF output
 
 * journal: find a way to allow dropping history early, based on priority, other rules

commit bcbd5405b1b6d9d219259e3be2c3ec4d92812bcb
Author: Will Woods <wwoods at redhat.com>
Date:   Tue Oct 16 17:04:34 2012 -0400

    mount: make sure m->where is set before unit_add_exec_dependencies()
    
    If you enter unit_add_exec_dependencies with m->where = NULL, you'll
    very likely end up aborting somewhere under socket_needs_mount.
    
    (When systemd goes to check to see if the journald socket requires your
    mount, it'll do path_startswith(path, m->where)... *kaboom*)
    
    This patch should ensure that:
    
        a) both branches in mount_add_one() set m->where, and
        b) mount_add_extras() calls unit_add_exec_dependencies() *after*
           setting m->where.

diff --git a/src/core/mount.c b/src/core/mount.c
index e1c240e..14f4863 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -547,10 +547,6 @@ static int mount_add_extras(Mount *m) {
         Unit *u = UNIT(m);
         int r;
 
-        r = unit_add_exec_dependencies(u, &m->exec_context);
-        if (r < 0)
-                return r;
-
         if (UNIT(m)->fragment_path)
                 m->from_fragment = true;
 
@@ -562,6 +558,10 @@ static int mount_add_extras(Mount *m) {
 
         path_kill_slashes(m->where);
 
+        r = unit_add_exec_dependencies(u, &m->exec_context);
+        if (r < 0)
+                return r;
+
         if (!UNIT(m)->description) {
                 r = unit_set_description(u, m->where);
                 if (r < 0)
@@ -1459,6 +1459,14 @@ static int mount_add_one(
                 delete = false;
                 free(e);
 
+                if (!MOUNT(u)->where) {
+                        MOUNT(u)->where = strdup(where);
+                        if (!MOUNT(u)->where) {
+                                r = -ENOMEM;
+                                goto fail;
+                        }
+                }
+
                 if (u->load_state == UNIT_ERROR) {
                         u->load_state = UNIT_LOADED;
                         u->load_error = 0;



More information about the systemd-commits mailing list