dbus-execute.c revision 8600c525cb1420570e7670c963abd19c5696b683
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering/***
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering This file is part of systemd.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering Copyright 2010 Lennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering systemd is free software; you can redistribute it and/or modify it
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering under the terms of the GNU Lesser General Public License as published by
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering (at your option) any later version.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering systemd is distributed in the hope that it will be useful, but
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering Lesser General Public License for more details.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering You should have received a copy of the GNU Lesser General Public License
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering***/
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering#include <errno.h>
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include <dbus/dbus.h>
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering#include <sys/prctl.h>
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering#include "dbus-execute.h"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include "missing.h"
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering#include "ioprio.h"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include "strv.h"
25300b5a1fcf54674a69d0f4ab08925be00b0227Lennart Poettering#include "dbus-common.h"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringDEFINE_BUS_PROPERTY_APPEND_ENUM(bus_execute_append_kill_mode, kill_mode, KillMode);
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart PoetteringDEFINE_BUS_PROPERTY_APPEND_ENUM(bus_execute_append_input, exec_input, ExecInput);
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1Lennart PoetteringDEFINE_BUS_PROPERTY_APPEND_ENUM(bus_execute_append_output, exec_output, ExecOutput);
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_env_files(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering char **env_files = data, **j;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering DBusMessageIter sub, sub2;
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "(sb)", &sub))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering STRV_FOREACH(j, env_files) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering dbus_bool_t b = false;
3a6fb33c54bc64398e0af1c9d7c74a6b614a849dLennart Poettering char *fn = *j;
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (fn[0] == '-') {
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering b = true;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering fn++;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &fn) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_BOOLEAN, &b) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_close_container(&sub, &sub2))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_close_container(i, &sub))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_oom_score_adjust(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int32_t n;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->oom_score_adjust_set)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = c->oom_score_adjust;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering char *t;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (read_one_line_file("/proc/self/oom_score_adj", &t) >= 0) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering safe_atoi(t, &n);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering free(t);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
03976f7b4a84b8b1492a549a3470b2bba8f37008Lennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, &n))
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
634af5665fda8776d22624d947c8de830e30a874Lennart Poetteringint bus_execute_append_nice(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int32_t n;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->nice_set)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = c->nice;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = getpriority(PRIO_PROCESS, 0);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, &n))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering return 0;
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering}
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_ioprio(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int32_t n;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->ioprio_set)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = c->ioprio;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = ioprio_get(IOPRIO_WHO_PROCESS, 0);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, &n))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_cpu_sched_policy(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int32_t n;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering if (c->cpu_sched_set)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = c->cpu_sched_policy;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = sched_getscheduler(0);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, &n))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_cpu_sched_priority(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int32_t n;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->cpu_sched_set)
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering n = c->cpu_sched_priority;
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering else {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering struct sched_param p;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering zero(p);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (sched_getparam(0, &p) >= 0)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering n = p.sched_priority;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_INT32, &n))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_affinity(DBusMessageIter *i, const char *property, void *data) {
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering ExecContext *c = data;
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering dbus_bool_t b;
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering DBusMessageIter sub;
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering
555bd6e95bf2b469306d9cd86e126c0122d0895bLennart Poettering assert(i);
9d485985338a46b8cb1acdf1af6c1eb2e88acfeeLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "y", &sub))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->cpuset)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering b = dbus_message_iter_append_fixed_array(&sub, DBUS_TYPE_BYTE, &c->cpuset, CPU_ALLOC_SIZE(c->cpuset_ncpus));
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else
634af5665fda8776d22624d947c8de830e30a874Lennart Poettering b = dbus_message_iter_append_fixed_array(&sub, DBUS_TYPE_BYTE, &c->cpuset, 0);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!b)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_close_container(i, &sub))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_timer_slack_nsec(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering uint64_t u;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->timer_slack_nsec != (nsec_t) -1)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering u = (uint64_t) c->timer_slack_nsec;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering u = (uint64_t) prctl(PR_GET_TIMERSLACK);
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT64, &u))
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering return -ENOMEM;
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_capability_bs(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering uint64_t normal, inverted;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering /* We store this negated internally, to match the kernel, but
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering * we expose it normalized. */
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering normal = *(uint64_t*) data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering inverted = ~normal;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return bus_property_append_uint64(i, property, &inverted);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
03976f7b4a84b8b1492a549a3470b2bba8f37008Lennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_capabilities(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering char *t = NULL;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering const char *s;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering dbus_bool_t b;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->capabilities)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering s = t = cap_to_text(c->capabilities, NULL);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering s = "";
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!s)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering b = dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &s);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (t)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering cap_free(t);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!b)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringint bus_execute_append_rlimits(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecContext *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int r;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering uint64_t u;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(c);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert_se((r = rlimit_from_string(property)) >= 0);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (c->rlimit[r])
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering u = (uint64_t) c->rlimit[r]->rlim_max;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering else {
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering struct rlimit rl;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering zero(rl);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering getrlimit(r, &rl);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering u = (uint64_t) rl.rlim_max;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_append_basic(i, DBUS_TYPE_UINT64, &u))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
9d485985338a46b8cb1acdf1af6c1eb2e88acfeeLennart Poetteringint bus_execute_append_command(DBusMessageIter *i, const char *property, void *data) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering ExecCommand *c = data;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering DBusMessageIter sub, sub2, sub3;
66a16e7e9fc501d371b57cbe2ae5d130fe930c6dThomas Hindoe Paaboel Andersen
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(i);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering assert(property);
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "(sasbttttuii)", &sub))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering LIST_FOREACH(command, c, c) {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering char **l;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering uint32_t pid;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering int32_t code, status;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering dbus_bool_t b;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!c->path)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering continue;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_open_container(&sub, DBUS_TYPE_STRUCT, NULL, &sub2) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_STRING, &c->path) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_open_container(&sub2, DBUS_TYPE_ARRAY, "s", &sub3))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering STRV_FOREACH(l, c->argv)
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_append_basic(&sub3, DBUS_TYPE_STRING, l))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
0dd25fb9f005d8ab7ac4bc10a609d00569f8c56aLennart Poettering pid = (uint32_t) c->exec_status.pid;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering code = (int32_t) c->exec_status.code;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering status = (int32_t) c->exec_status.status;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering b = !!c->ignore;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_close_container(&sub2, &sub3) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_BOOLEAN, &b) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT64, &c->exec_status.start_timestamp.realtime) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT64, &c->exec_status.start_timestamp.monotonic) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT64, &c->exec_status.exit_timestamp.realtime) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT64, &c->exec_status.exit_timestamp.monotonic) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_UINT32, &pid) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_INT32, &code) ||
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering !dbus_message_iter_append_basic(&sub2, DBUS_TYPE_INT32, &status))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_close_container(&sub, &sub2))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering }
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering if (!dbus_message_iter_close_container(i, &sub))
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return -ENOMEM;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering return 0;
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering}
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poetteringconst BusProperty bus_exec_context_properties[] = {
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "Environment", bus_property_append_strv, "as", offsetof(ExecContext, environment), true },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "EnvironmentFiles", bus_execute_append_env_files, "a(sb)", offsetof(ExecContext, environment_files), true },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "UMask", bus_property_append_mode, "u", offsetof(ExecContext, umask) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitCPU", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitFSIZE", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitDATA", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitSTACK", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitCORE", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitRSS", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitNOFILE", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitAS", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitNPROC", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitMEMLOCK", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitLOCKS", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitSIGPENDING", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitMSGQUEUE", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitNICE", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitRTPRIO", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "LimitRTTIME", bus_execute_append_rlimits, "t", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "WorkingDirectory", bus_property_append_string, "s", offsetof(ExecContext, working_directory), true },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "RootDirectory", bus_property_append_string, "s", offsetof(ExecContext, root_directory), true },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "OOMScoreAdjust", bus_execute_append_oom_score_adjust, "i", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "Nice", bus_execute_append_nice, "i", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "IOScheduling", bus_execute_append_ioprio, "i", 0 },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "CPUSchedulingPolicy", bus_execute_append_cpu_sched_policy, "i", 0 },
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering { "CPUSchedulingPriority", bus_execute_append_cpu_sched_priority, "i", 0 },
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering { "CPUAffinity", bus_execute_append_affinity, "ay", 0 },
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering { "TimerSlackNSec", bus_execute_append_timer_slack_nsec, "t", 0 },
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering { "CPUSchedulingResetOnFork", bus_property_append_bool, "b", offsetof(ExecContext, cpu_sched_reset_on_fork) },
e70df46b9721a3d025e7a0b4ffb5893cbde5e55dLennart Poettering { "NonBlocking", bus_property_append_bool, "b", offsetof(ExecContext, non_blocking) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "StandardInput", bus_execute_append_input, "s", offsetof(ExecContext, std_input) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "StandardOutput", bus_execute_append_output, "s", offsetof(ExecContext, std_output) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "StandardError", bus_execute_append_output, "s", offsetof(ExecContext, std_error) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "TTYPath", bus_property_append_string, "s", offsetof(ExecContext, tty_path), true },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "TTYReset", bus_property_append_bool, "b", offsetof(ExecContext, tty_reset) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "TTYVHangup", bus_property_append_bool, "b", offsetof(ExecContext, tty_vhangup) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "TTYVTDisallocate", bus_property_append_bool, "b", offsetof(ExecContext, tty_vt_disallocate) },
cabb0bc6b1a4ec57e108dc99364687d7c4f9670fLennart Poettering { "SyslogPriority", bus_property_append_int, "i", offsetof(ExecContext, syslog_priority) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "SyslogIdentifier", bus_property_append_string, "s", offsetof(ExecContext, syslog_identifier), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "SyslogLevelPrefix", bus_property_append_bool, "b", offsetof(ExecContext, syslog_level_prefix) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "Capabilities", bus_execute_append_capabilities, "s", 0 },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "SecureBits", bus_property_append_int, "i", offsetof(ExecContext, secure_bits) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "CapabilityBoundingSet", bus_execute_append_capability_bs, "t", offsetof(ExecContext, capability_bounding_set_drop) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "User", bus_property_append_string, "s", offsetof(ExecContext, user), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "Group", bus_property_append_string, "s", offsetof(ExecContext, group), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "SupplementaryGroups", bus_property_append_strv, "as", offsetof(ExecContext, supplementary_groups), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "TCPWrapName", bus_property_append_string, "s", offsetof(ExecContext, tcpwrap_name), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "PAMName", bus_property_append_string, "s", offsetof(ExecContext, pam_name), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "ReadWriteDirectories", bus_property_append_strv, "as", offsetof(ExecContext, read_write_dirs), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "ReadOnlyDirectories", bus_property_append_strv, "as", offsetof(ExecContext, read_only_dirs), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "InaccessibleDirectories", bus_property_append_strv, "as", offsetof(ExecContext, inaccessible_dirs), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "MountFlags", bus_property_append_ul, "t", offsetof(ExecContext, mount_flags) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "PrivateTmp", bus_property_append_bool, "b", offsetof(ExecContext, private_tmp) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "PrivateNetwork", bus_property_append_bool, "b", offsetof(ExecContext, private_network) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "SameProcessGroup", bus_property_append_bool, "b", offsetof(ExecContext, same_pgrp) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "KillMode", bus_execute_append_kill_mode, "s", offsetof(ExecContext, kill_mode) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "KillSignal", bus_property_append_int, "i", offsetof(ExecContext, kill_signal) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "UtmpIdentifier", bus_property_append_string, "s", offsetof(ExecContext, utmp_id), true },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "ControlGroupModify", bus_property_append_bool, "b", offsetof(ExecContext, control_group_modify) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "ControlGroupPersistent", bus_property_append_tristate_false, "b", offsetof(ExecContext, control_group_persistent) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { "IgnoreSIGPIPE", bus_property_append_bool, "b", offsetof(ExecContext, ignore_sigpipe ) },
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering { NULL, }
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering};
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering