mirror of
https://github.com/restic/restic.git
synced 2026-08-28 08:23:19 +00:00
Update vendored library github.com/pkg/xattr
This commit is contained in:
+11
-1
@@ -32,7 +32,9 @@ func List(path string) ([]string, error) {
|
||||
return nil, &Error{"xattr.List", path, "", err}
|
||||
}
|
||||
if size > 0 {
|
||||
buf := make([]byte, size)
|
||||
// `size + 1` because of ERANGE error when reading
|
||||
// from a SMB1 mount point (https://github.com/pkg/xattr/issues/16).
|
||||
buf := make([]byte, size+1)
|
||||
// Read into buffer of that size.
|
||||
read, err := syscall.Listxattr(path, buf)
|
||||
if err != nil {
|
||||
@@ -59,3 +61,11 @@ func Remove(path, name string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Supported checks if filesystem supports extended attributes
|
||||
func Supported(path string) bool {
|
||||
if _, err := syscall.Listxattr(path, nil); err != nil {
|
||||
return err != syscall.ENOTSUP
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user