From 263709da8c1a711cf4979cdcbba2d90d110f9779 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 21 Jul 2024 15:03:17 +0200 Subject: [PATCH] fs: unexport isListxattrPermissionError --- internal/fs/node_aix.go | 4 ++-- internal/fs/node_netbsd.go | 4 ++-- internal/fs/node_openbsd.go | 4 ++-- internal/fs/node_xattr.go | 4 ++-- internal/fs/node_xattr_test.go | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/fs/node_aix.go b/internal/fs/node_aix.go index 4e6944425..123985c2d 100644 --- a/internal/fs/node_aix.go +++ b/internal/fs/node_aix.go @@ -35,8 +35,8 @@ func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error { return nil } -// IsListxattrPermissionError is a no-op on AIX. -func IsListxattrPermissionError(_ error) bool { +// isListxattrPermissionError is a no-op on AIX. +func isListxattrPermissionError(_ error) bool { return false } diff --git a/internal/fs/node_netbsd.go b/internal/fs/node_netbsd.go index c71e4bdf5..996125851 100644 --- a/internal/fs/node_netbsd.go +++ b/internal/fs/node_netbsd.go @@ -25,8 +25,8 @@ func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error { return nil } -// IsListxattrPermissionError is a no-op on netbsd. -func IsListxattrPermissionError(_ error) bool { +// isListxattrPermissionError is a no-op on netbsd. +func isListxattrPermissionError(_ error) bool { return false } diff --git a/internal/fs/node_openbsd.go b/internal/fs/node_openbsd.go index f74f2ae00..62eb78618 100644 --- a/internal/fs/node_openbsd.go +++ b/internal/fs/node_openbsd.go @@ -25,8 +25,8 @@ func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error { return nil } -// IsListxattrPermissionError is a no-op on openbsd. -func IsListxattrPermissionError(_ error) bool { +// isListxattrPermissionError is a no-op on openbsd. +func isListxattrPermissionError(_ error) bool { return false } diff --git a/internal/fs/node_xattr.go b/internal/fs/node_xattr.go index 11bdf382b..55376ba58 100644 --- a/internal/fs/node_xattr.go +++ b/internal/fs/node_xattr.go @@ -28,7 +28,7 @@ func listxattr(path string) ([]string, error) { return l, handleXattrErr(err) } -func IsListxattrPermissionError(err error) bool { +func isListxattrPermissionError(err error) bool { var xerr *xattr.Error if errors.As(err, &xerr) { return xerr.Op == "xattr.list" && errors.Is(xerr.Err, os.ErrPermission) @@ -106,7 +106,7 @@ func nodeFillExtendedAttributes(node *restic.Node, path string, ignoreListError xattrs, err := listxattr(path) debug.Log("fillExtendedAttributes(%v) %v %v", path, xattrs, err) if err != nil { - if ignoreListError && IsListxattrPermissionError(err) { + if ignoreListError && isListxattrPermissionError(err) { return nil } return err diff --git a/internal/fs/node_xattr_test.go b/internal/fs/node_xattr_test.go index d948e3b31..3784dba45 100644 --- a/internal/fs/node_xattr_test.go +++ b/internal/fs/node_xattr_test.go @@ -19,10 +19,10 @@ func TestIsListxattrPermissionError(t *testing.T) { } err := handleXattrErr(xerr) rtest.Assert(t, err != nil, "missing error") - rtest.Assert(t, IsListxattrPermissionError(err), "expected IsListxattrPermissionError to return true for %v", err) + rtest.Assert(t, isListxattrPermissionError(err), "expected IsListxattrPermissionError to return true for %v", err) xerr.Err = os.ErrNotExist err = handleXattrErr(xerr) rtest.Assert(t, err != nil, "missing error") - rtest.Assert(t, !IsListxattrPermissionError(err), "expected IsListxattrPermissionError to return false for %v", err) + rtest.Assert(t, !isListxattrPermissionError(err), "expected IsListxattrPermissionError to return false for %v", err) }