mirror of
https://github.com/systemd/systemd
synced 2024-09-15 22:30:22 +00:00
analyze: do not prepend the current working directory to SYSTEMD_UNIT_PATH needlessly
If the requested unit is not in the current working directory, it is not
necessary to include the current working directory in SYSTEMD_UNIT_PATH.
Follow-up for 45519d13a4
.
Fixes #30166.
This commit is contained in:
parent
ff7af46edb
commit
2f6181ad4d
|
@ -86,6 +86,9 @@ int verify_set_unit_path(char **filenames) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (access(a, F_OK) < 0)
|
||||
continue;
|
||||
|
||||
r = path_extract_directory(a, &t);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
@ -99,6 +102,9 @@ int verify_set_unit_path(char **filenames) {
|
|||
if (!joined)
|
||||
return -ENOMEM;
|
||||
|
||||
if (isempty(joined))
|
||||
return 0;
|
||||
|
||||
/* First, prepend our directories. Second, if some path was specified, use that, and
|
||||
* otherwise use the defaults. Any duplicates will be filtered out in path-lookup.c.
|
||||
* Treat explicit empty path to mean that nothing should be appended. */
|
||||
|
|
Loading…
Reference in a new issue