bus-endpoint.c revision 96f2f3b1b5f44eb59d23d2abeac12b33a18e1e21
/***
This file is part of systemd.
Copyright 2014 Daniel Mack
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdlib.h>
#include "bus-endpoint.h"
{
if (!*ep)
return -ENOMEM;
return 0;
}
{
int r;
/* check if we already have this name in the policy list. If we do, see if the new access level
* is higher than the exising one, and upgrade the entry in that case. Otherwise, do nothing.
*/
if (ep->policy_hash) {
if (po) {
return 0;
}
} else {
if (!ep->policy_hash)
return -ENOMEM;
}
if (!po)
return -ENOMEM;
if (!key)
return -ENOMEM;
if (r < 0)
return r;
return 0;
}
{
if (!endpoint)
return;
}