From 7410616cd9dbbec97cf98d75324da5cda2b2f7a2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 30 Apr 2015 20:21:00 +0200 Subject: core: rework unit name validation and manipulation logic A variety of changes: - Make sure all our calls distuingish OOM from other errors if OOM is not the only error possible. - Be much stricter when parsing escaped paths, do not accept trailing or leading escaped slashes. - Change unit validation to take a bit mask for allowing plain names, instance names or template names or an combination thereof. - Refuse manipulating invalid unit name --- src/dbus1-generator/dbus1-generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dbus1-generator') diff --git a/src/dbus1-generator/dbus1-generator.c b/src/dbus1-generator/dbus1-generator.c index 2e08af2df2..c909a4b1da 100644 --- a/src/dbus1-generator/dbus1-generator.c +++ b/src/dbus1-generator/dbus1-generator.c @@ -188,7 +188,7 @@ static int add_dbus(const char *path, const char *fname, const char *type) { } if (service) { - if (!unit_name_is_valid(service, TEMPLATE_INVALID)) { + if (!unit_name_is_valid(service, UNIT_NAME_PLAIN|UNIT_NAME_INSTANCE)) { log_warning("Unit name %s is not valid, ignoring.", service); return 0; } -- cgit v1.2.3-54-g00ecf