selinux-access.h revision 03e22642617f360a6b55cb853bcf59604754ea5d
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering This file is part of systemd.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Copyright 2012 Dan Walsh
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering (at your option) any later version.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is distributed in the hope that it will be useful, but
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Lesser General Public License for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poetteringint selinux_access_check(DBusConnection *connection, DBusMessage *message, const char *path, const char *permission, DBusError *error);
23c80348e656a4e6fd9ba8f17523a65b6fa349a0Kay Sievers#define SELINUX_ACCESS_CHECK(connection, message, permission) \
4cee5eede280b7fd48c18a1942616c4ac896a554Lennart Poettering _r = selinux_access_check(_c, _m, NULL, (permission), &_error); \
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering return bus_send_error_reply(_c, _m, &_error, _r); \
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering } while (false)
3ffd4af22052963e7a29431721ee204e634bea75Lennart Poettering#define SELINUX_UNIT_ACCESS_CHECK(unit, connection, message, permission) \
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering _r = selinux_access_check(_c, _m, _u->source_path ?: _u->fragment_path, (permission), &_error); \
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering return bus_send_error_reply(_c, _m, &_error, _r); \
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering } while (false)
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering#define SELINUX_ACCESS_CHECK(connection, message, permission) do { } while (false)
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering#define SELINUX_UNIT_ACCESS_CHECK(unit, connection, message, permission) do { } while (false)