diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-27 04:55:19 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-27 04:55:19 +0100 |
commit | b952f2e17587167867f3564e06a6548dbd5c3d5a (patch) | |
tree | e1686233a7a19aa25de607a180219584fe5709e5 /load-dropin.c | |
parent | b9cd2ec1c8be840e6271265d983e66d9907ecbe4 (diff) |
don't choke on invalid dropin file names
Diffstat (limited to 'load-dropin.c')
-rw-r--r-- | load-dropin.c | 7 |
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); |