aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-02-07 20:00:33 +0100
committerJakob Unterwurzacher2021-02-07 20:00:33 +0100
commitbb2484f1520102f4ab6c84400f9eef53d4cdd2ad (patch)
tree994f07b8e12de0882acd85547b828ec0432158de
parent4b4a68eb21a0c58e82a3753c430e7d560fbd4805 (diff)
tests/xattr: fix acl blob
The blob was truncated to 31 bytes.
-rw-r--r--tests/xattr/xattr_integration_test.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/xattr/xattr_integration_test.go b/tests/xattr/xattr_integration_test.go
index b7b6e69..be48fc0 100644
--- a/tests/xattr/xattr_integration_test.go
+++ b/tests/xattr/xattr_integration_test.go
@@ -347,15 +347,24 @@ func TestAcl(t *testing.T) {
t.Fatalf("creating empty file failed: %v", err)
}
// ACLs are blobs generated in userspace, let's steal a valid ACL from
- // setfacl using strace:
+ // setfacl:
//
- // $ strace -e setxattr setfacl -m u:root:r file
- // setxattr("file", "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\2\0\4\0\0\0\0\0\4\0\4\0\377\377\377\377\20\0\4", 44, 0) = 0
+ // $ setfacl -m u:root:r file
+ // $ getfattr -n system.posix_acl_access file
+ // # file: file
+ // system.posix_acl_access=0sAgAAAAEABgD/////AgAEAAAAAAAEAAQA/////xAABAD/////IAAEAP////8=
//
// The ACL gives user root additional read rights, in other words, it should
// have no effect at all.
- acl := "\002\000\000\000\001\000\006\000\377\377\377\377\002\000\004\000\000\000\000\000\004\000\004\000\377\377\377\377\020\000\004"
- err = setGetRmList3(fn, "system.posix_acl_access", []byte(acl))
+
+ acl, err := base64.StdEncoding.DecodeString("AgAAAAEABgD/////AgAEAAAAAAAEAAQA/////xAABAD/////IAAEAP////8=")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(acl) != 44 {
+ t.Fatal(len(acl))
+ }
+ err = setGetRmList3(fn, "system.posix_acl_access", acl)
if err != nil {
t.Error(err)
}