summaryrefslogtreecommitdiff
path: root/src/core/device.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-31 03:28:37 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-31 08:56:03 -0400
commitb2fadec6048adb3596f2633cb7fe7a49f5937a18 (patch)
tree8969997ed3730146ff98774b14b3dcd65392c4df /src/core/device.c
parenta2a5291b3f5ab6ed4c92f51d0fd10a03047380d8 (diff)
Properly report invalid quoted strings
$ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument
Diffstat (limited to 'src/core/device.c')
-rw-r--r--src/core/device.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 2c41c7b6f4..0f28a16874 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -223,14 +223,13 @@ static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
const char *word, *state;
size_t l;
int r;
+ const char *property;
assert(u);
assert(dev);
- wants = udev_device_get_property_value(
- dev,
- u->manager->running_as == SYSTEMD_USER ? "SYSTEMD_USER_WANTS" : "SYSTEMD_WANTS");
-
+ property = u->manager->running_as == SYSTEMD_USER ? "SYSTEMD_USER_WANTS" : "SYSTEMD_WANTS";
+ wants = udev_device_get_property_value(dev, property);
if (!wants)
return 0;
@@ -249,6 +248,9 @@ static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
if (r < 0)
return r;
}
+ if (!isempty(state))
+ log_warning_unit(u->id, "Property %s on %s has trailing garbage, ignoring.",
+ property, strna(udev_device_get_syspath(dev)));
return 0;
}
@@ -407,6 +409,8 @@ static int device_process_new_device(Manager *m, struct udev_device *dev) {
else
log_warning("SYSTEMD_ALIAS for %s is not an absolute path, ignoring: %s", sysfs, e);
}
+ if (!isempty(state))
+ log_warning("SYSTEMD_ALIAS for %s has trailing garbage, ignoring.", sysfs);
}
return 0;