]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
load-fragment: don't try to do a template instance replacement if we are not an insta...
authorLennart Poettering <lennart@poettering.net>
Thu, 9 Jun 2016 08:49:36 +0000 (10:49 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Thu, 9 Jun 2016 08:49:36 +0000 (10:49 +0200)
Corrects: 7aad67e7

Fixes: #3438
src/core/load-fragment.c

index b53301a147eb3b2ed26331412a49b114456c17b7..2d8f6296c88f31e480b9a132c5f6b6dde0f04463 100644 (file)
@@ -3743,7 +3743,7 @@ static int merge_by_names(Unit **u, Set *names, const char *id) {
 
                         /* If the symlink name we are looking at is unit template, then
                            we must search for instance of this template */
-                        if (unit_name_is_valid(k, UNIT_NAME_TEMPLATE)) {
+                        if (unit_name_is_valid(k, UNIT_NAME_TEMPLATE) && (*u)->instance) {
                                 _cleanup_free_ char *instance = NULL;
 
                                 r = unit_name_replace_instance(k, (*u)->instance, &instance);