core: don't try to load units from non-absolute paths

The error message disagreed with the check that was actually performed. Adjust the check.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-09-18 14:48:40 +02:00
parent 0af07108e4
commit 526e3cbbdd

View File

@@ -1973,10 +1973,9 @@ int manager_load_unit_prepare(
assert(m);
assert(_ret);
/* This will prepare the unit for loading, but not actually
* load anything from disk. */
/* This will prepare the unit for loading, but not actually load anything from disk. */
if (path && !is_path(path))
if (path && !path_is_absolute(path))
return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Path %s is not absolute.", path);
if (!name) {