|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 81fc054dc7c365545bca86d78bf36a12658cedb3 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Lukas Nykryn <lnykryn@redhat.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Tue, 26 Aug 2014 13:33:08 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] systemctl: fix broken list-unit-files with --root
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/shared/install.c | 7 ++++++-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/shared/install.c b/src/shared/install.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 4b09a69456..3ef995a928 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/shared/install.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/shared/install.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2072,6 +2072,7 @@ int unit_file_get_list(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
for (;;) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
_cleanup_(unit_file_list_free_onep) UnitFileList *f = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
struct dirent *de;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ _cleanup_free_ char *path = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
errno = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
de = readdir(d);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2121,7 +2122,11 @@ int unit_file_get_list(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
goto found;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- r = unit_file_can_install(&paths, root_dir, f->path, true);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ path = path_make_absolute(de->d_name, *i);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (!path)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ return -ENOMEM;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ r = unit_file_can_install(&paths, root_dir, path, true);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (r == -EINVAL || /* Invalid setting? */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r == -EBADMSG || /* Invalid format? */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r == -ENOENT /* Included file not found? */)
|