#include "polkit.h"
#include "def.h"
#include "virt.h"
+#include "env-util.h"
+#include "fileio-label.h"
+#include "label.h"
#define INTERFACE \
" <interface name=\"org.freedesktop.hostname1\">\n" \
return 0;
}
-
- return write_one_line_file_atomic("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
+ return write_one_line_file_atomic_label("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
}
static int write_data_other(void) {
return 0;
}
- r = write_env_file("/etc/machine-info", l);
+ r = write_env_file_label("/etc/machine-info", l);
strv_free(l);
return r;
* safe than sorry */
if (k == PROP_ICON_NAME && !filename_is_safe(name))
return bus_send_error_reply(connection, message, NULL, -EINVAL);
- if (k == PROP_PRETTY_HOSTNAME && !string_is_safe(name))
+ if (k == PROP_PRETTY_HOSTNAME && string_has_cc(name))
return bus_send_error_reply(connection, message, NULL, -EINVAL);
if (k == PROP_CHASSIS && !valid_chassis(name))
return bus_send_error_reply(connection, message, NULL, -EINVAL);
if (!reply)
goto oom;
- if (!dbus_connection_send(connection, reply, NULL))
+ if (!bus_maybe_send_reply(connection, message, reply))
goto oom;
dbus_message_unref(reply);
log_open();
umask(0022);
+ label_init("/etc");
if (argc == 2 && streq(argv[1], "--introspect")) {
fputs(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE