mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
Vendor in containers/buildah@v1.26.1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/buildah/copier/xattrs.go
generated
vendored
8
vendor/github.com/containers/buildah/copier/xattrs.go
generated
vendored
@@ -16,7 +16,9 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
relevantAttributes = []string{"security.capability", "security.ima", "user.*"} // the attributes that we preserve - we discard others
|
||||
relevantAttributes = []string{"security.capability", "security.ima", "user.*"} // the attributes that we preserve - we discard others
|
||||
initialXattrListSize = 64 * 1024
|
||||
initialXattrValueSize = 64 * 1024
|
||||
)
|
||||
|
||||
// isRelevantXattr checks if "attribute" matches one of the attribute patterns
|
||||
@@ -35,7 +37,7 @@ func isRelevantXattr(attribute string) bool {
|
||||
// Lgetxattrs returns a map of the relevant extended attributes set on the given file.
|
||||
func Lgetxattrs(path string) (map[string]string, error) {
|
||||
maxSize := 64 * 1024 * 1024
|
||||
listSize := 64 * 1024
|
||||
listSize := initialXattrListSize
|
||||
var list []byte
|
||||
for listSize < maxSize {
|
||||
list = make([]byte, listSize)
|
||||
@@ -61,7 +63,7 @@ func Lgetxattrs(path string) (map[string]string, error) {
|
||||
m := make(map[string]string)
|
||||
for _, attribute := range strings.Split(string(list), string('\000')) {
|
||||
if isRelevantXattr(attribute) {
|
||||
attributeSize := 64 * 1024
|
||||
attributeSize := initialXattrValueSize
|
||||
var attributeValue []byte
|
||||
for attributeSize < maxSize {
|
||||
attributeValue = make([]byte, attributeSize)
|
||||
|
||||
Reference in New Issue
Block a user