From da8b28a5e64197e43a5f1a3ad68821dbc1940689 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 10 Mar 2021 13:45:56 -0500 Subject: [PATCH] chown: ignore both pkg/system.EOPNOTSUPP and pkg/system.ErrNotSupportedPlatform Where we ignored a pkg/system.ErrNotSupportedPlatform error from pkg/system.Lgetxattr(), also ignore ENOTSUP/EOPNOTSUPP, as we already do elsewhere. Signed-off-by: Nalin Dahyabhai --- drivers/chown_unix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/chown_unix.go b/drivers/chown_unix.go index 7c2a73f6b8..0387adfc12 100644 --- a/drivers/chown_unix.go +++ b/drivers/chown_unix.go @@ -3,6 +3,7 @@ package graphdriver import ( + "errors" "fmt" "os" "syscall" @@ -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) }