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:
parent
b9cd2ec1c8
commit
b952f2e175
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user