mirror of
https://github.com/mudler/luet.git
synced 2025-06-29 16:56:55 +00:00
Enable NoLchown
This caused to drop file permissions
This commit is contained in:
parent
4f1e4c0b41
commit
f0a34f1cf0
@ -95,9 +95,7 @@ func UntarProtect(src, dst string, sameOwner bool, protectedFiles []string, modi
|
|||||||
replacerArchive := archive.ReplaceFileTarWrapper(in, mods)
|
replacerArchive := archive.ReplaceFileTarWrapper(in, mods)
|
||||||
|
|
||||||
opts := &archive.TarOptions{
|
opts := &archive.TarOptions{
|
||||||
// NOTE: NoLchown boolean is used for chmod of the symlink
|
NoLchown: false,
|
||||||
// Probably it's needed set this always to true.
|
|
||||||
NoLchown: true,
|
|
||||||
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
|
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
|
||||||
ContinueOnError: true,
|
ContinueOnError: true,
|
||||||
}
|
}
|
||||||
@ -201,12 +199,8 @@ func Untar(src, dest string, sameOwner bool) error {
|
|||||||
defer in.Close()
|
defer in.Close()
|
||||||
|
|
||||||
if sameOwner {
|
if sameOwner {
|
||||||
// PRE: i have root privileged.
|
|
||||||
|
|
||||||
opts := &archive.TarOptions{
|
opts := &archive.TarOptions{
|
||||||
// NOTE: NoLchown boolean is used for chmod of the symlink
|
NoLchown: false,
|
||||||
// Probably it's needed set this always to true.
|
|
||||||
NoLchown: true,
|
|
||||||
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
|
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
|
||||||
ContinueOnError: true,
|
ContinueOnError: true,
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ func (c *Client) Unpack(image, dest string) error {
|
|||||||
// Unpack the tarfile to the rootfs path.
|
// Unpack the tarfile to the rootfs path.
|
||||||
// FROM: https://godoc.org/github.com/moby/moby/pkg/archive#TarOptions
|
// FROM: https://godoc.org/github.com/moby/moby/pkg/archive#TarOptions
|
||||||
if err := archive.Untar(content.NewReader(layer), dest, &archive.TarOptions{
|
if err := archive.Untar(content.NewReader(layer), dest, &archive.TarOptions{
|
||||||
NoLchown: true,
|
NoLchown: false,
|
||||||
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
|
ExcludePatterns: []string{"dev/"}, // prevent 'operation not permitted'
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return fmt.Errorf("extracting tar for %s to directory %s failed: %v", desc.Digest.String(), dest, err)
|
return fmt.Errorf("extracting tar for %s to directory %s failed: %v", desc.Digest.String(), dest, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user