Skip to content

Commit

Permalink
Merge pull request #851 from nalind/check-lgetxattr
Browse files Browse the repository at this point in the history
chown: ignore both pkg/system.EOPNOTSUPP and pkg/system.ErrNotSupportedPlatform
  • Loading branch information
giuseppe committed Mar 11, 2021
2 parents 7df1ede + da8b28a commit 3c13812
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/chown_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package graphdriver

import (
"errors"
"fmt"
"os"
"syscall"
Expand Down Expand Up @@ -49,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 && err != system.ErrNotSupportedPlatform {
if err != nil && !errors.Is(err, system.EOPNOTSUPP) && err != system.ErrNotSupportedPlatform {
return fmt.Errorf("%s: %v", os.Args[0], err)
}

Expand Down

0 comments on commit 3c13812

Please sign in to comment.