chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3fde5f3
)
systemctl: make sure set-property mangles unit names
author
Lennart Poettering
<lennart@poettering.net>
Thu, 26 Sep 2013 22:11:54 +0000
(
00:11
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 26 Sep 2013 22:11:54 +0000
(
00:11
+0200)
src/systemctl/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl/systemctl.c
b/src/systemctl/systemctl.c
index 8b9183dcb3c1ca54aaa84fb517b8aff77052c684..eede616e50ae6f8ba03ebff3ffbdce71ca55bba3 100644
(file)
--- a/
src/systemctl/systemctl.c
+++ b/
src/systemctl/systemctl.c
@@
-3829,7
+3829,8
@@
static int append_assignment(DBusMessageIter *iter, const char *assignment) {
static int set_property(DBusConnection *bus, char **args) {
static int set_property(DBusConnection *bus, char **args) {
- _cleanup_free_ DBusMessage *m = NULL, *reply = NULL;
+ _cleanup_dbus_message_unref_ DBusMessage *m = NULL, *reply = NULL;
+ _cleanup_free_ char *n = NULL;
DBusMessageIter iter, sub;
dbus_bool_t runtime;
DBusError error;
DBusMessageIter iter, sub;
dbus_bool_t runtime;
DBusError error;
@@
-3850,7
+3851,11
@@
static int set_property(DBusConnection *bus, char **args) {
runtime = arg_runtime;
runtime = arg_runtime;
- if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &args[1]) ||
+ n = unit_name_mangle(args[1]);
+ if (!n)
+ return log_oom();
+
+ if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &n) ||
!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &runtime) ||
!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(sv)", &sub))
return log_oom();
!dbus_message_iter_append_basic(&iter, DBUS_TYPE_BOOLEAN, &runtime) ||
!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(sv)", &sub))
return log_oom();