chiark / gitweb /
selinux: prefer source path over fragment path
authorLennart Poettering <lennart@poettering.net>
Mon, 17 Sep 2012 23:55:24 +0000 (01:55 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 17 Sep 2012 23:55:24 +0000 (01:55 +0200)
src/core/dbus-unit.c
src/core/selinux-access.c

index d86f60e498061e485c0533e16b80d35ccb74fc2e..3d3458bed7de2fd13f30a02c26117132a2c38861 100644 (file)
@@ -420,9 +420,9 @@ static DBusHandlerResult bus_unit_message_dispatch(Unit *u, DBusConnection *conn
                 connection,
                 message,
                 m,
-                (u->fragment_path ? u->fragment_path: u->source_path),
+                u->source_path ? u->source_path : u->fragment_path,
                 &error);
-        if (r)
+        if (r < 0)
                 return bus_send_error_reply(connection, message, &error, r);
 
         if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Unit", "Start"))
index 30eab68336b76f41c7e2b9005ecb10d26099a093..fc1df866cfe215d75b109c834c5c250ed4c9f626 100644 (file)
@@ -684,7 +684,7 @@ int selinux_manager_access_check(DBusConnection *connection, DBusMessage *messag
                         }
                 }
 
-                path = (u->fragment_path ? u->fragment_path: u->source_path);
+                path = u->source_path ? u->source_path : u->fragment_path;
         }
         r = selinux_access_check(connection, message, m, error, perm, path);