diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-25 16:23:22 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-25 16:23:22 +0900 |
| commit | 2a348c7f912a17dbb0d29624cb3bef2add9d7492 (patch) | |
| tree | fd13835b3f70ccac14af4a6f47c1342d5ee0b6f7 /acl/export.go | |
| parent | eb767e7642ccd581c9b29303f5e7e3b2adc87c09 (diff) | |
system: include more info in ACL Stringer
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'acl/export.go')
| -rw-r--r-- | acl/export.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/acl/export.go b/acl/export.go index 104de517..13a2a3f3 100644 --- a/acl/export.go +++ b/acl/export.go @@ -25,7 +25,25 @@ const ( Other = C.ACL_OTHER ) -type Perm C.acl_perm_t +type ( + Perm C.acl_perm_t + 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) +} func UpdatePerm(path string, uid int, perms ...Perm) error { // read acl from file |
