|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
From b6df45d1c129fc95078b47d9124eca1143a7fa64 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
Date: Sat, 21 Mar 2015 18:50:10 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
Subject: [PATCH] core: make SELinux enable/disable check symmetric
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
We'd use the generic check for disable, and a unit-file-specific one for enable.
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
Use the more specific one both ways.
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
systemd[1]: SELinux access check scon=system_u:system_r:systemd_timedated_t:s0 tcon=system_u:system_r:init_t:s0 tclass=system perm=disable path=(null) cmdline=/usr/lib/systemd/systemd-timedated: -13
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
systemd[1]: SELinux access check scon=system_u:system_r:systemd_timedated_t:s0 tcon=system_u:object_r:systemd_unit_file_t:s0 tclass=service perm=enable path=/usr/lib/systemd/system/systemd-timesyncd.service cmdline=/usr/lib/systemd/systemd-timedated: -13
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
https://bugzilla.redhat.com/show_bug.cgi?id=1014315
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
(cherry picked from commit df823e23f04da832ad5fc078176f8c26597a9845)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
Conflicts:
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
src/core/dbus-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
---
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
src/core/dbus-manager.c | 6 +++---
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
index 8ba665dc3d..2bc37ba60e 100644
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
--- a/src/core/dbus-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+++ b/src/core/dbus-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
@@ -1772,15 +1772,15 @@ static int method_disable_unit_files_generic(
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
- r = mac_selinux_access_check(message, verb, error);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+ r = sd_bus_message_read_strv(message, &l);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
- r = sd_bus_message_read_strv(message, &l);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+ r = sd_bus_message_read(message, "b", &runtime);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
- r = sd_bus_message_read(message, "b", &runtime);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+ r = mac_selinux_unit_access_check_strv(l, message, m, verb, error);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|