mirror of
https://github.com/containers/podman.git
synced 2025-09-12 18:09:45 +08:00
Vendor in latest github.com/containers/storage,image, buildah
Grab latest fixes from subpackages Including fixes for usernamespace chowning retaining file attributes Better logging of error messages. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
12
vendor/github.com/containers/storage/drivers/chown_unix.go
generated
vendored
12
vendor/github.com/containers/storage/drivers/chown_unix.go
generated
vendored
@ -8,6 +8,7 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/containers/storage/pkg/idtools"
|
||||
"github.com/containers/storage/pkg/system"
|
||||
)
|
||||
|
||||
func platformLChown(path string, info os.FileInfo, toHost, toContainer *idtools.IDMappings) error {
|
||||
@ -49,6 +50,11 @@ func platformLChown(path string, info os.FileInfo, toHost, toContainer *idtools.
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: lstat(%q): %v", os.Args[0], path, err)
|
||||
}
|
||||
cap, err := system.Lgetxattr(path, "security.capability")
|
||||
if err != nil && err != system.ErrNotSupportedPlatform {
|
||||
return fmt.Errorf("%s: Lgetxattr(%q): %v", os.Args[0], path, err)
|
||||
}
|
||||
|
||||
// Make the change.
|
||||
if err := syscall.Lchown(path, uid, gid); err != nil {
|
||||
return fmt.Errorf("%s: chown(%q): %v", os.Args[0], path, err)
|
||||
@ -59,6 +65,12 @@ func platformLChown(path string, info os.FileInfo, toHost, toContainer *idtools.
|
||||
return fmt.Errorf("%s: chmod(%q): %v", os.Args[0], path, err)
|
||||
}
|
||||
}
|
||||
if cap != nil {
|
||||
if err := system.Lsetxattr(path, "security.capability", cap, 0); err != nil {
|
||||
return fmt.Errorf("%s: Lsetxattr(%q): %v", os.Args[0], path, err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user