mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
Remove absolute paths from files
tarballs should only have relative paths in. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
e7fc277fd2
commit
796d943054
@ -529,6 +529,10 @@ func filesystem(m Moby, tw *tar.Writer) error {
|
|||||||
if f.Path == "" {
|
if f.Path == "" {
|
||||||
return errors.New("Did not specify path for file")
|
return errors.New("Did not specify path for file")
|
||||||
}
|
}
|
||||||
|
// tar archives should not have absolute paths
|
||||||
|
if f.Path[0] == os.PathSeparator {
|
||||||
|
f.Path = f.Path[1:]
|
||||||
|
}
|
||||||
mode := int64(0600)
|
mode := int64(0600)
|
||||||
if f.Directory {
|
if f.Directory {
|
||||||
mode = 0700
|
mode = 0700
|
||||||
|
Loading…
Reference in New Issue
Block a user