Skip to content

Commit

Permalink
fix storage-chown-by-maps doesnt handle -EOVERFLOW return by lgetxattr [
Browse files Browse the repository at this point in the history
Closes #1183]

Signed-off-by: robertzaage <38880514+robertzaage@users.noreply.github.com>
  • Loading branch information
robertzaage committed Apr 6, 2022
1 parent 4fb40a4 commit e9964ee
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 e9964ee

Please sign in to comment.