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 d86f60e..3d3458b 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 30eab68..fc1df86 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);