bus-endpoint.c revision 96f2f3b1b5f44eb59d23d2abeac12b33a18e1e21
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering This file is part of systemd.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering Copyright 2014 Daniel Mack
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering systemd is free software; you can redistribute it and/or modify it
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering under the terms of the GNU Lesser General Public License as published by
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering (at your option) any later version.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering systemd is distributed in the hope that it will be useful, but
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering Lesser General Public License for more details.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering You should have received a copy of the GNU Lesser General Public License
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poetteringint bus_endpoint_add_policy(BusEndpoint *ep, const char *name, BusPolicyAccess access)
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering _cleanup_free_ BusEndpointPolicy *po = NULL;
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering assert(access > _BUS_POLICY_ACCESS_INVALID && access < _BUS_POLICY_ACCESS_MAX);
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering /* check if we already have this name in the policy list. If we do, see if the new access level
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering * is higher than the exising one, and upgrade the entry in that case. Otherwise, do nothing.
a016b9228f338cb9b380ce7e00826ef462767d98Lennart Poettering ep->policy_hash = hashmap_new(&string_hash_ops);
if (!po)
return -ENOMEM;
if (!key)
return -ENOMEM;
if (!endpoint)