From d1bd348d6d0a133ac9a8856a52cb488d904af407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Noack?= Date: Sun, 5 Sep 2021 22:06:31 +0200 Subject: [PATCH] Add AccessFSSet lookup by shortened file system operation names. Fixes #14. This helper will return an error when invoked with an invalid or duplicate name. The supported names correspond to the Landlock file system operations and are notated in lowercase with underscores, for example "execute", "write_file", "read_dir", "make_fifo". --- landlock/accessfs.go | 40 +++++++++++++++++++++++++++++++++++++++ landlock/accessfs_test.go | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/landlock/accessfs.go b/landlock/accessfs.go index 7725b1c..f74902a 100644 --- a/landlock/accessfs.go +++ b/landlock/accessfs.go @@ -5,6 +5,7 @@ import ( "strings" ) +// Flag names by bit index, e.g. index n corresponds to AccessFSSet flag 1<