1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
3 #ifndef foodbusexecutehfoo
4 #define foodbusexecutehfoo
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 #include <dbus/dbus.h>
29 #define BUS_EXEC_CONTEXT_INTERFACE \
30 " <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
31 " <property name=\"UMask\" type=\"u\" access=\"read\"/>\n" \
32 " <property name=\"LimitCPU\" type=\"t\" access=\"read\"/>\n" \
33 " <property name=\"LimitFSIZE\" type=\"t\" access=\"read\"/>\n" \
34 " <property name=\"LimitDATA\" type=\"t\" access=\"read\"/>\n" \
35 " <property name=\"LimitSTACK\" type=\"t\" access=\"read\"/>\n" \
36 " <property name=\"LimitCORE\" type=\"t\" access=\"read\"/>\n" \
37 " <property name=\"LimitRSS\" type=\"t\" access=\"read\"/>\n" \
38 " <property name=\"LimitNOFILE\" type=\"t\" access=\"read\"/>\n" \
39 " <property name=\"LimitAS\" type=\"t\" access=\"read\"/>\n" \
40 " <property name=\"LimitNPROC\" type=\"t\" access=\"read\"/>\n" \
41 " <property name=\"LimitMEMLOCK\" type=\"t\" access=\"read\"/>\n" \
42 " <property name=\"LimitLOCKS\" type=\"t\" access=\"read\"/>\n" \
43 " <property name=\"LimitSIGPENDING\" type=\"t\" access=\"read\"/>\n" \
44 " <property name=\"LimitMSGQUEUE\" type=\"t\" access=\"read\"/>\n" \
45 " <property name=\"LimitNICE\" type=\"t\" access=\"read\"/>\n" \
46 " <property name=\"LimitRTPRIO\" type=\"t\" access=\"read\"/>\n" \
47 " <property name=\"LimitRTTIME\" type=\"t\" access=\"read\"/>\n" \
48 " <property name=\"WorkingDirectory\" type=\"s\" access=\"read\"/>\n" \
49 " <property name=\"RootDirectory\" type=\"s\" access=\"read\"/>\n" \
50 " <property name=\"OOMAdjust\" type=\"i\" access=\"read\"/>\n" \
51 " <property name=\"Nice\" type=\"i\" access=\"read\"/>\n" \
52 " <property name=\"IOScheduling\" type=\"i\" access=\"read\"/>\n" \
53 " <property name=\"CPUSchedulingPolicy\" type=\"i\" access=\"read\"/>\n" \
54 " <property name=\"CPUSchedulingPriority\" type=\"i\" access=\"read\"/>\n" \
55 " <property name=\"CPUAffinity\" type=\"ay\" access=\"read\"/>\n" \
56 " <property name=\"TimerSlackNS\" type=\"t\" access=\"read\"/>\n" \
57 " <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\"read\"/>\n" \
58 " <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>\n" \
59 " <property name=\"StandardInput\" type=\"s\" access=\"read\"/>\n" \
60 " <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>\n" \
61 " <property name=\"StandardError\" type=\"s\" access=\"read\"/>\n" \
62 " <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n" \
63 " <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n" \
64 " <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>\n" \
65 " <property name=\"SyslogNoPrefix\" type=\"b\" access=\"read\"/>\n" \
66 " <property name=\"Capabilities\" type=\"s\" access=\"read\"/>\n" \
67 " <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \
68 " <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>\n" \
69 " <property name=\"User\" type=\"s\" access=\"read\"/>\n" \
70 " <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \
71 " <property name=\"SupplementaryGroups\" type=\"as\" access=\"read\"/>\n" \
72 " <property name=\"TCPWrapName\" type=\"s\" access=\"read\"/>\n" \
73 " <property name=\"PAMName\" type=\"s\" access=\"read\"/>\n" \
74 " <property name=\"ReadWriteDirectories\" type=\"as\" access=\"read\"/>\n" \
75 " <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read\"/>\n" \
76 " <property name=\"InaccessibleDirectories\" type=\"as\" access=\"read\"/>\n" \
77 " <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \
78 " <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \
79 " <property name=\"NoSetSID\" type=\"b\" access=\"read\"/>\n" \
81 #define BUS_EXEC_CONTEXT_PROPERTIES(interface, context) \
82 { interface, "Environment", bus_property_append_strv, "as", (context).environment }, \
83 { interface, "UMask", bus_property_append_mode, "u", &(context).umask }, \
84 { interface, "LimitCPU", bus_execute_append_rlimits, "t", &(context) }, \
85 { interface, "LimitFSIZE", bus_execute_append_rlimits, "t", &(context) }, \
86 { interface, "LimitDATA", bus_execute_append_rlimits, "t", &(context) }, \
87 { interface, "LimitSTACK", bus_execute_append_rlimits, "t", &(context) }, \
88 { interface, "LimitCORE", bus_execute_append_rlimits, "t", &(context) }, \
89 { interface, "LimitRSS", bus_execute_append_rlimits, "t", &(context) }, \
90 { interface, "LimitNOFILE", bus_execute_append_rlimits, "t", &(context) }, \
91 { interface, "LimitAS", bus_execute_append_rlimits, "t", &(context) }, \
92 { interface, "LimitNPROC", bus_execute_append_rlimits, "t", &(context) }, \
93 { interface, "LimitMEMLOCK", bus_execute_append_rlimits, "t", &(context) }, \
94 { interface, "LimitLOCKS", bus_execute_append_rlimits, "t", &(context) }, \
95 { interface, "LimitSIGPENDING", bus_execute_append_rlimits, "t", &(context) }, \
96 { interface, "LimitMSGQUEUE", bus_execute_append_rlimits, "t", &(context) }, \
97 { interface, "LimitNICE", bus_execute_append_rlimits, "t", &(context) }, \
98 { interface, "LimitRTPRIO", bus_execute_append_rlimits, "t", &(context) }, \
99 { interface, "LimitRTTIME", bus_execute_append_rlimits, "t", &(context) }, \
100 { interface, "WorkingDirectory", bus_property_append_string, "s", (context).working_directory }, \
101 { interface, "RootDirectory", bus_property_append_string, "s", (context).root_directory }, \
102 { interface, "OOMAdjust", bus_execute_append_oom_adjust, "i", &(context) }, \
103 { interface, "Nice", bus_execute_append_nice, "i", &(context) }, \
104 { interface, "IOScheduling", bus_execute_append_ioprio, "i", &(context) }, \
105 { interface, "CPUSchedulingPolicy", bus_execute_append_cpu_sched_policy, "i", &(context) }, \
106 { interface, "CPUSchedulingPriority", bus_execute_append_cpu_sched_priority, "i", &(context) }, \
107 { interface, "CPUAffinity", bus_execute_append_affinity,"ay", &(context) }, \
108 { interface, "TimerSlackNS", bus_execute_append_timer_slack_ns, "t", &(context) }, \
109 { interface, "CPUSchedulingResetOnFork", bus_property_append_bool, "b", &(context).cpu_sched_reset_on_fork }, \
110 { interface, "NonBlocking", bus_property_append_bool, "b", &(context).non_blocking }, \
111 { interface, "StandardInput", bus_execute_append_input, "s", &(context).std_input }, \
112 { interface, "StandardOutput", bus_execute_append_output, "s", &(context).std_output }, \
113 { interface, "StandardError", bus_execute_append_output, "s", &(context).std_error }, \
114 { interface, "TTYPath", bus_property_append_string, "s", (context).tty_path }, \
115 { interface, "SyslogPriority", bus_property_append_int, "i", &(context).syslog_priority }, \
116 { interface, "SyslogIdentifier", bus_property_append_string, "s", (context).syslog_identifier }, \
117 { interface, "SyslogNoPrefix", bus_property_append_bool, "b", &(context).syslog_no_prefix }, \
118 { interface, "Capabilities", bus_property_append_string, "s", (context).capabilities }, \
119 { interface, "SecureBits", bus_property_append_int, "i", &(context).secure_bits }, \
120 { interface, "CapabilityBoundingSetDrop", bus_property_append_uint64, "t", &(context).capability_bounding_set_drop }, \
121 { interface, "User", bus_property_append_string, "s", (context).user }, \
122 { interface, "Group", bus_property_append_string, "s", (context).group }, \
123 { interface, "SupplementaryGroups", bus_property_append_strv, "as", (context).supplementary_groups }, \
124 { interface, "TCPWrapName", bus_property_append_string, "s", (context).tcpwrap_name }, \
125 { interface, "PAMName", bus_property_append_string, "s", (context).pam_name }, \
126 { interface, "ReadWriteDirectories", bus_property_append_strv, "as", (context).read_write_dirs }, \
127 { interface, "ReadOnlyDirectories", bus_property_append_strv, "as", (context).read_only_dirs }, \
128 { interface, "InaccessibleDirectories", bus_property_append_strv, "as", (context).inaccessible_dirs }, \
129 { interface, "MountFlags", bus_property_append_ul, "t", &(context).mount_flags }, \
130 { interface, "PrivateTmp", bus_property_append_bool, "b", &(context).private_tmp }, \
131 { interface, "NoSetSID", bus_property_append_bool, "b", &(context).no_setsid }
133 int bus_execute_append_output(Manager *m, DBusMessageIter *i, const char *property, void *data);
134 int bus_execute_append_input(Manager *m, DBusMessageIter *i, const char *property, void *data);
135 int bus_execute_append_oom_adjust(Manager *m, DBusMessageIter *i, const char *property, void *data);
136 int bus_execute_append_nice(Manager *m, DBusMessageIter *i, const char *property, void *data);
137 int bus_execute_append_ioprio(Manager *m, DBusMessageIter *i, const char *property, void *data);
138 int bus_execute_append_cpu_sched_policy(Manager *m, DBusMessageIter *i, const char *property, void *data);
139 int bus_execute_append_cpu_sched_priority(Manager *m, DBusMessageIter *i, const char *property, void *data);
140 int bus_execute_append_affinity(Manager *m, DBusMessageIter *i, const char *property, void *data);
141 int bus_execute_append_timer_slack_ns(Manager *m, DBusMessageIter *i, const char *property, void *data);
142 int bus_execute_append_capabilities(Manager *m, DBusMessageIter *i, const char *property, void *data);
143 int bus_execute_append_rlimits(Manager *m, DBusMessageIter *i, const char *property, void *data);