diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2014-08-26 13:33:08 +0200 |
---|---|---|
committer | Lukas Nykryn <lnykryn@redhat.com> | 2014-08-27 11:48:48 +0200 |
commit | 81fc054dc7c365545bca86d78bf36a12658cedb3 (patch) | |
tree | 2f3fe42244151610e10df1af89c3de4ee15f3e8f | |
parent | e512e8a255ef29d5a8eb605f8849202ea3d3e4cb (diff) |
systemctl: fix broken list-unit-files with --root
-rw-r--r-- | src/shared/install.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shared/install.c b/src/shared/install.c index 4b09a69456..3ef995a928 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -2072,6 +2072,7 @@ int unit_file_get_list( for (;;) { _cleanup_(unit_file_list_free_onep) UnitFileList *f = NULL; struct dirent *de; + _cleanup_free_ char *path = NULL; errno = 0; de = readdir(d); @@ -2121,7 +2122,11 @@ int unit_file_get_list( goto found; } - r = unit_file_can_install(&paths, root_dir, f->path, true); + path = path_make_absolute(de->d_name, *i); + if (!path) + return -ENOMEM; + + r = unit_file_can_install(&paths, root_dir, path, true); if (r == -EINVAL || /* Invalid setting? */ r == -EBADMSG || /* Invalid format? */ r == -ENOENT /* Included file not found? */) |