chiark / gitweb /
selinux: use standard D-Bus error id for access denied
authorLennart Poettering <lennart@poettering.net>
Mon, 24 Sep 2012 21:56:35 +0000 (23:56 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 24 Sep 2012 21:56:35 +0000 (23:56 +0200)
src/core/bus-errors.h
src/core/selinux-access.c

index dca7824bd81fd7e71fb630aed51aaeae4cd2e3d9..04c1b2849d20f2cd5ef858aea0bcbfa742d503a6 100644 (file)
@@ -43,7 +43,6 @@
 #define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.TransactionOrderIsCyclic"
 #define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown"
 #define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess"
 #define BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC "org.freedesktop.systemd1.TransactionOrderIsCyclic"
 #define BUS_ERROR_SHUTTING_DOWN "org.freedesktop.systemd1.ShuttingDown"
 #define BUS_ERROR_NO_SUCH_PROCESS "org.freedesktop.systemd1.NoSuchProcess"
-#define BUS_ERROR_ACCESS_DENIED "org.freedesktop.systemd1.AccessDenied"
 
 static inline const char *bus_error(const DBusError *e, int r) {
         if (e && e->message)
 
 static inline const char *bus_error(const DBusError *e, int r) {
         if (e && e->message)
index 8513634f965bc9758d4e7d32cb8ed79d155545f0..5edb09a0e95a2fca77e281056c290d65ba105cc3 100644 (file)
@@ -329,7 +329,7 @@ static int selinux_init(Manager *m, DBusError *error) {
                 /* if not first time is not set, then initialize access */
                 r = access_init();
                 if (r < 0) {
                 /* if not first time is not set, then initialize access */
                 r = access_init();
                 if (r < 0) {
-                        dbus_set_error(error, BUS_ERROR_ACCESS_DENIED, "Unable to initialize SELinux.");
+                        dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED, "Unable to initialize SELinux.");
 
                         return r;
                 }
 
                         return r;
                 }
@@ -477,7 +477,7 @@ static int selinux_access_check(DBusConnection *connection, DBusMessage *message
                 tclass = "system";
                 r = getcon(&fcon);
                 if (r < 0) {
                 tclass = "system";
                 r = getcon(&fcon);
                 if (r < 0) {
-                        dbus_set_error(error, BUS_ERROR_ACCESS_DENIED, "Unable to get current context, SELinux policy denies access.");
+                        dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED, "Unable to get current context, SELinux policy denies access.");
                         goto finish;
                 }
         }
                         goto finish;
                 }
         }
@@ -490,7 +490,7 @@ static int selinux_access_check(DBusConnection *connection, DBusMessage *message
                 r = -errno;
                 log_error("SELinux Denied \"%s\"", audit.cmdline);
 
                 r = -errno;
                 log_error("SELinux Denied \"%s\"", audit.cmdline);
 
-                dbus_set_error(error, BUS_ERROR_ACCESS_DENIED, "SELinux policy denies access.");
+                dbus_set_error(error, DBUS_ERROR_ACCESS_DENIED, "SELinux policy denies access.");
         }
 
         log_debug("SELinux checkaccess scon %s tcon %s tclass %s perm %s path %s: %d", scon, fcon, tclass, perm, path, r);
         }
 
         log_debug("SELinux checkaccess scon %s tcon %s tclass %s perm %s path %s: %d", scon, fcon, tclass, perm, path, r);