0
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-18 22:53:40 +08:00

don't choke on invalid dropin file names

This commit is contained in:
Lennart Poettering 2010-01-27 04:55:19 +01:00
parent b9cd2ec1c8
commit b952f2e175

View File

@ -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);