1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2012 Dan Walsh
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 void selinux_access_finish(void);
25 int selinux_manager_access_check(Manager *manager, DBusConnection *connection, DBusMessage *message, const char *permission, DBusError *error);
26 int selinux_unit_access_check(Unit *unit, DBusConnection *connection, DBusMessage *message, const char *permission, DBusError *error);
30 #define SELINUX_MANAGER_ACCESS_CHECK(manager, connection, message, permission) \
34 DBusConnection *_c = (connection); \
35 DBusMessage *_m = (message); \
36 dbus_error_init(&_error); \
37 _r = selinux_manager_access_check((manager), _c, _m, (permission), &_error); \
39 return bus_send_error_reply(_c, _m, &_error, _r); \
42 #define SELINUX_UNIT_ACCESS_CHECK(unit, connection, message, permission) \
46 DBusConnection *_c = (connection); \
47 DBusMessage *_m = (message); \
48 dbus_error_init(&_error); \
49 _r = selinux_unit_access_check((unit), _c, _m, (permission), &_error); \
51 return bus_send_error_reply(_c, _m, &_error, _r); \
56 #define SELINUX_MANAGER_ACCESS_CHECK(manager, connection, message, permission) do { } while (false)
57 #define SELINUX_UNIT_ACCESS_CHECK(unit, connection, message, permission) do { } while (false)