aboutsummaryrefslogtreecommitdiffhomepage
path: root/acl/acl.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-12-16 18:27:19 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-12-16 18:27:19 +0900
commitc8a90666c5a683df2259d15683086a3a8dfdde14 (patch)
tree7c922413dd18baf3230243c8798d342d7e42b930 /acl/acl.go
parentee41b37606fbf9085e239922a1362f1c8c13d542 (diff)
acl: refactor and clean up
Move all C code to c.go, switch to pkg-config, set up finalizer for acl. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'acl/acl.go')
-rw-r--r--acl/acl.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/acl/acl.go b/acl/acl.go
new file mode 100644
index 00000000..8b775688
--- /dev/null
+++ b/acl/acl.go
@@ -0,0 +1,19 @@
+// Package acl implements simple ACL manipulation via libacl.
+package acl
+
+type Perms []Perm
+
+func (ps Perms) String() string {
+ var s = []byte("---")
+ for _, p := range ps {
+ switch p {
+ case Read:
+ s[0] = 'r'
+ case Write:
+ s[1] = 'w'
+ case Execute:
+ s[2] = 'x'
+ }
+ }
+ return string(s)
+}