/***
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 "alloc-util.h"
#include "bus-endpoint.h"
#include "bus-kernel.h"
#include "bus-policy.h"
#include "kdbus.h"
struct kdbus_item *n;
Iterator i;
int r;
}
n->type = KDBUS_ITEM_NAME;
n = KDBUS_ITEM_NEXT(n);
n->type = KDBUS_ITEM_POLICY_ACCESS;
n = KDBUS_ITEM_NEXT(n);
}
if (r < 0)
return -errno;
return 0;
}
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;
}