Skip to content

Commit

Permalink
Merge pull request #1244 from TomSweeneyRedHat/dev/tsweeney/eoverflow…
Browse files Browse the repository at this point in the history
…-1-38

[release-1.38] Backport EOVERFLOW on lgetxattr
  • Loading branch information
rhatdan committed May 25, 2022
2 parents e9510f4 + bae4154 commit 46d68bd
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func platformLChown(path string, info os.FileInfo, toHost, toContainer *idtools.
}
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 46d68bd

Please sign in to comment.