Skip to content

Commit

Permalink
Merge pull request #1190 from robertzaage/main
Browse files Browse the repository at this point in the history
fix storage-chown-by-maps doesnt handle -EOVERFLOW on lgetxattr [Closes #1183]
  • Loading branch information
giuseppe committed Apr 7, 2022
2 parents 4fb40a4 + 28f3ba9 commit 5d55c44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/chown_unix.go
Expand Up @@ -84,7 +84,7 @@ func (c *platformChowner) LChown(path string, info os.FileInfo, toHost, toContai
}
if uid != int(st.Uid) || gid != int(st.Gid) {
cap, err := system.Lgetxattr(path, "security.capability")
if err != nil && !errors.Is(err, system.EOPNOTSUPP) && err != system.ErrNotSupportedPlatform {
if err != nil && !errors.Is(err, system.EOPNOTSUPP) && !errors.Is(err, system.EOVERFLOW) && err != system.ErrNotSupportedPlatform {
return fmt.Errorf("%s: %v", os.Args[0], err)
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/system/xattrs_linux.go
Expand Up @@ -13,6 +13,9 @@ const (

// Operation not supported
EOPNOTSUPP unix.Errno = unix.EOPNOTSUPP

// Value is too small or too large for maximum size allowed
EOVERFLOW unix.Errno = unix.EOVERFLOW
)

// Lgetxattr retrieves the value of the extended attribute identified by attr
Expand Down
3 changes: 3 additions & 0 deletions pkg/system/xattrs_unsupported.go
Expand Up @@ -10,6 +10,9 @@ const (

// Operation not supported
EOPNOTSUPP syscall.Errno = syscall.Errno(0)

// Value is too small or too large for maximum size allowed
EOVERFLOW syscall.Errno = syscall.Errno(0)
)

// Lgetxattr is not supported on platforms other than linux.
Expand Down

0 comments on commit 5d55c44

Please sign in to comment.