summaryrefslogtreecommitdiff
path: root/tests/xattr/xattr_fd_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-11-11 17:43:48 +0100
committerJakob Unterwurzacher2019-01-01 16:24:25 +0100
commit2286372603f506cf719654a9901de0749c544b12 (patch)
tree3281d54570b9a06e5be756a57d049900848db182 /tests/xattr/xattr_fd_test.go
parentb97d7d1d33d1274c6872d899692a56bd4070a6d9 (diff)
fusefrontend: make GetXAttr() symlink-safe on Linux
Uses the /proc/self/fd trick, which does not work on Darwin.
Diffstat (limited to 'tests/xattr/xattr_fd_test.go')
-rw-r--r--tests/xattr/xattr_fd_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/xattr/xattr_fd_test.go b/tests/xattr/xattr_fd_test.go
index 7d37a57..ad0b7ed 100644
--- a/tests/xattr/xattr_fd_test.go
+++ b/tests/xattr/xattr_fd_test.go
@@ -34,6 +34,9 @@ func TestFdXattr(t *testing.T) {
val1 := []byte("123456789")
unix.Fsetxattr(fd, attr, val1, 0)
sz, err = unix.Flistxattr(fd, buf)
+ if err != nil {
+ t.Fatal(err)
+ }
// Length of "user.attr" + terminating null byte
expectedSz := len(attr) + 1
if sz != expectedSz {
@@ -45,6 +48,9 @@ func TestFdXattr(t *testing.T) {
}
// Check content
sz, err = unix.Fgetxattr(fd, attr, buf)
+ if err != nil {
+ t.Fatal(err)
+ }
str = string(buf[:sz])
if str != string(val1) {
t.Errorf("expected val %q, got %q", val1, str)