If the path is absolute was only checked later.
Also do not check if path if absolute if we just
specified it starting with a slash.
case CREATE_SYMLINK:
if (!i->argument) {
- i->argument = strappend("/usr/share/factory", i->path);
+ i->argument = strappend("/usr/share/factory/", i->path);
if (!i->argument)
return log_oom();
}
case COPY_FILES:
if (!i->argument) {
- i->argument = strappend("/usr/share/factory", i->path);
+ i->argument = strappend("/usr/share/factory/", i->path);
if (!i->argument)
return log_oom();
- }
-
- if (!path_is_absolute(i->argument)) {
+ } else if (!path_is_absolute(i->argument)) {
log_error("[%s:%u] Source path is not absolute.", fname, line);
return -EBADMSG;
}