summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-27 04:55:19 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-27 04:55:19 +0100
commitb952f2e17587167867f3564e06a6548dbd5c3d5a (patch)
treee1686233a7a19aa25de607a180219584fe5709e5
parentb9cd2ec1c8be840e6271265d983e66d9907ecbe4 (diff)
don't choke on invalid dropin file names
-rw-r--r--load-dropin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/load-dropin.c b/load-dropin.c
index b975d83f04..a57bfc455b 100644
--- a/load-dropin.c
+++ b/load-dropin.c
@@ -5,6 +5,7 @@
#include "unit.h"
#include "load-dropin.h"
+#include "log.h"
int unit_load_dropin(Unit *u) {
Iterator i;
@@ -51,6 +52,12 @@ int unit_load_dropin(Unit *u) {
return -ENOMEM;
}
+ if (!unit_name_is_valid(de->d_name)) {
+ log_info("Name of %s is not a valid unit name. Ignoring.", path);
+ free(path);
+ continue;
+ }
+
r = manager_load_unit(u->meta.manager, path, &other);
free(path);