Check if the system-target path supplied is absolute

docker.Untar
(https://github.com/mudler/luet/blob/master/vendor/github.com/docker/docker/pkg/archive/archive.go#L942) requires absolute paths.
We didn't do any input validation before, assuming the path passed by
were absolute since they were coming from YAML configuration files, now
that this is not the truth anymore we need to sanitize the input.

With this change we check if the given path is absolute or relative, if
it's relative we calculate the absolute path and use it in place.
This commit is contained in:
Ettore Di Giacinto
2021-08-03 16:17:55 +02:00
parent 75906c4198
commit 9d1594c036
13 changed files with 27 additions and 11 deletions

View File

@@ -48,7 +48,7 @@ This commands takes multiple packages as arguments and prunes their entries from
LuetCfg.System.DatabaseEngine = engine
LuetCfg.System.DatabasePath = dbpath
LuetCfg.System.Rootfs = rootfs
LuetCfg.System.SetRootFS(rootfs)
systemDB := LuetCfg.GetSystemDB()