mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
systemctl: fix broken list-unit-files with --root
This commit is contained in:
parent
e512e8a255
commit
81fc054dc7
Notes:
Lennart Poettering
2014-10-24 17:30:27 +02:00
Backport: bugfix
@ -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? */)
|
||||
|
Loading…
x
Reference in New Issue
Block a user