mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
Merge pull request #77 from justincormack/tar-abs
Remove absolute paths from files
This commit is contained in:
commit
6b4bae6832
@ -529,6 +529,10 @@ func filesystem(m Moby, tw *tar.Writer) error {
|
||||
if f.Path == "" {
|
||||
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)
|
||||
if f.Directory {
|
||||
mode = 0700
|
||||
|
Loading…
Reference in New Issue
Block a user