From dd30083c2b539e7d982b47275e394edd2d775432 Mon Sep 17 00:00:00 2001 From: gum3ng Date: Mon, 10 Jan 2022 13:34:18 +0530 Subject: [PATCH] [#issue 3127] Add xattr support for Solaris --- changelog/unreleased/issue-3127 | 7 +++++++ doc/020_installation.rst | 2 ++ go.mod | 2 +- go.sum | 4 ++-- internal/restic/node_solaris.go | 16 ---------------- internal/restic/node_xattr.go | 3 ++- 6 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 changelog/unreleased/issue-3127 diff --git a/changelog/unreleased/issue-3127 b/changelog/unreleased/issue-3127 new file mode 100644 index 000000000..39dff73de --- /dev/null +++ b/changelog/unreleased/issue-3127 @@ -0,0 +1,7 @@ +Enhancement: Add xattr support for Solaris + +We added xattr support for the Solaris operating system. This enables restic +to support xattrs on Solaris. + +https://github.com/restic/restic/issues/3127 +https://github.com/restic/restic/pull/3628 diff --git a/doc/020_installation.rst b/doc/020_installation.rst index 198eebd8e..d02feb3d8 100644 --- a/doc/020_installation.rst +++ b/doc/020_installation.rst @@ -302,6 +302,8 @@ supply the target OS and platform via the command-line options like this $ go run build.go --goos linux --goarch arm --goarm 6 + $ go run build.go --goos solaris --goarch amd64 + The resulting binary is statically linked and does not require any libraries. diff --git a/go.mod b/go.mod index 8920927bd..e48168643 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/pkg/profile v1.6.0 github.com/pkg/sftp v1.13.2 - github.com/pkg/xattr v0.4.3 + github.com/pkg/xattr v0.4.5 github.com/restic/chunker v0.4.0 github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 76a3bd10b..c75aaa73a 100644 --- a/go.sum +++ b/go.sum @@ -285,8 +285,8 @@ github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdL github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.2 h1:taJnKntsWgU+qae21Rx52lIwndAdKrj0mfUNQsz1z4Q= github.com/pkg/sftp v1.13.2/go.mod h1:LzqnAvaD5TWeNBsZpfKxSYn1MbjWwOsCIAFFJbpIsK8= -github.com/pkg/xattr v0.4.3 h1:5Jx4GCg5ABtqWZH8WLzeI4fOtM1HyX4RBawuCoua1es= -github.com/pkg/xattr v0.4.3/go.mod h1:sBD3RAqlr8Q+RC3FutZcikpT8nyDrIEEBw2J744gVWs= +github.com/pkg/xattr v0.4.5 h1:P5SvUc1T07cHLto76ESJ+/x5kexU7s9127iVoeEW/hs= +github.com/pkg/xattr v0.4.5/go.mod h1:sBD3RAqlr8Q+RC3FutZcikpT8nyDrIEEBw2J744gVWs= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= diff --git a/internal/restic/node_solaris.go b/internal/restic/node_solaris.go index a4ccc7211..c9d03f9c2 100644 --- a/internal/restic/node_solaris.go +++ b/internal/restic/node_solaris.go @@ -9,19 +9,3 @@ func (node Node) restoreSymlinkTimestamps(path string, utimes [2]syscall.Timespe func (s statT) atim() syscall.Timespec { return s.Atim } func (s statT) mtim() syscall.Timespec { return s.Mtim } func (s statT) ctim() syscall.Timespec { return s.Ctim } - -// Getxattr retrieves extended attribute data associated with path. -func Getxattr(path, name string) ([]byte, error) { - return nil, nil -} - -// Listxattr retrieves a list of names of extended attributes associated with the -// given path in the file system. -func Listxattr(path string) ([]string, error) { - return nil, nil -} - -// Setxattr associates name and data together as an attribute of path. -func Setxattr(path, name string, data []byte) error { - return nil -} diff --git a/internal/restic/node_xattr.go b/internal/restic/node_xattr.go index f66ddab84..642eb8df4 100644 --- a/internal/restic/node_xattr.go +++ b/internal/restic/node_xattr.go @@ -1,4 +1,5 @@ -// +build darwin freebsd linux +//go:build darwin || freebsd || linux || solaris +// +build darwin freebsd linux solaris package restic