1289
1289
nih_assert (message);
1290
1290
nih_assert (job_details);
1292
if (! control_check_permission (message)) {
1293
nih_dbus_error_raise_printf (
1294
DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1295
_("You do not have permission to modify job environment"));
1293
1299
if (job_details[0]) {
1294
1300
job_name = job_details[0];
1305
if (! control_check_permission (message)) {
1306
nih_dbus_error_raise_printf (
1307
DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1308
_("You do not have permission to modify job environment"));
1311
if (! var || ! *var) {
1312
nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS,
1313
_("Variable may not be empty string"));
1649
1665
nih_assert (message);
1650
1666
nih_assert (job_details);
1668
if (! control_check_permission (message)) {
1669
nih_dbus_error_raise_printf (
1670
DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1671
_("You do not have permission to modify job environment"));
1652
1675
if (job_details[0]) {
1653
1676
job_name = job_details[0];
1664
if (! control_check_permission (message)) {
1665
nih_dbus_error_raise_printf (
1666
DBUS_INTERFACE_UPSTART ".Error.PermissionDenied",
1667
_("You do not have permission to modify job environment"));
1671
1687
/* Verify that job name is valid */
1672
1688
if (job_name && ! strlen (job_name)) {
1673
1689
nih_dbus_error_raise_printf (DBUS_ERROR_INVALID_ARGS,
1908
* control_serialise_bus_address:
1910
* Convert control_bus_address into JSON representation.
1912
* Returns: JSON string representing control_bus_address or NULL if
1913
* control_bus_address not set or on error.
1915
* Note: If NULL is returned, check the value of control_bus_address
1916
* itself to determine if the error is real.
1919
control_serialise_bus_address (void)
1923
/* A NULL return represents a JSON null */
1924
return control_bus_address
1925
? json_object_new_string (control_bus_address)
1930
* control_deserialise_bus_address:
1932
* @json: root of JSON-serialised state.
1934
* Convert JSON representation of control_bus_address back into a native
1937
* Returns: 0 on success, -1 on error.
1940
control_deserialise_bus_address (json_object *json)
1942
const char *address;
1945
nih_assert (! control_bus_address);
1949
/* control_bus_address was never set */
1950
if (state_check_json_type (json, null))
1953
if (! state_check_json_type (json, string))
1956
address = json_object_get_string (json);
1960
control_bus_address = nih_strdup (NULL, address);
1961
if (! control_bus_address)