diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-11-05 02:47:43 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-11-05 02:47:43 +0900 |
| commit | c1399f5030abde76728ba7982a7a22fd49e75359 (patch) | |
| tree | 06e2a2ce11dbd7536150fd57824e406f101d50d9 /container/seccomp | |
| parent | 9ac63aac0cb025d1de195dbc57d0c89ebd1d7cc5 (diff) | |
std: rename from comp
Seccomp lookup tables are going to be relocated here, and PNR constants.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/seccomp')
| -rw-r--r-- | container/seccomp/hash_amd64_test.go | 2 | ||||
| -rw-r--r-- | container/seccomp/hash_arm64_test.go | 2 | ||||
| -rw-r--r-- | container/seccomp/hash_test.go | 4 | ||||
| -rw-r--r-- | container/seccomp/libseccomp_test.go | 2 | ||||
| -rw-r--r-- | container/seccomp/presets.go | 26 |
5 files changed, 18 insertions, 18 deletions
diff --git a/container/seccomp/hash_amd64_test.go b/container/seccomp/hash_amd64_test.go index eb3e6092..c021772c 100644 --- a/container/seccomp/hash_amd64_test.go +++ b/container/seccomp/hash_amd64_test.go @@ -1,8 +1,8 @@ package seccomp_test import ( - . "hakurei.app/container/comp" . "hakurei.app/container/seccomp" + . "hakurei.app/container/std" ) var bpfExpected = bpfLookup{ diff --git a/container/seccomp/hash_arm64_test.go b/container/seccomp/hash_arm64_test.go index 44c692d5..a445d3b7 100644 --- a/container/seccomp/hash_arm64_test.go +++ b/container/seccomp/hash_arm64_test.go @@ -1,8 +1,8 @@ package seccomp_test import ( - . "hakurei.app/container/comp" . "hakurei.app/container/seccomp" + . "hakurei.app/container/std" ) var bpfExpected = bpfLookup{ diff --git a/container/seccomp/hash_test.go b/container/seccomp/hash_test.go index 90bfe638..b86d49ba 100644 --- a/container/seccomp/hash_test.go +++ b/container/seccomp/hash_test.go @@ -4,14 +4,14 @@ import ( "crypto/sha512" "encoding/hex" - "hakurei.app/container/comp" "hakurei.app/container/seccomp" + "hakurei.app/container/std" ) type ( bpfPreset = struct { seccomp.ExportFlag - comp.FilterPreset + std.FilterPreset } bpfLookup map[bpfPreset][sha512.Size]byte ) diff --git a/container/seccomp/libseccomp_test.go b/container/seccomp/libseccomp_test.go index cb5a29cb..f46c36db 100644 --- a/container/seccomp/libseccomp_test.go +++ b/container/seccomp/libseccomp_test.go @@ -6,8 +6,8 @@ import ( "syscall" "testing" - . "hakurei.app/container/comp" . "hakurei.app/container/seccomp" + . "hakurei.app/container/std" ) func TestLibraryError(t *testing.T) { diff --git a/container/seccomp/presets.go b/container/seccomp/presets.go index 1f6f7290..8e9eaeb6 100644 --- a/container/seccomp/presets.go +++ b/container/seccomp/presets.go @@ -5,32 +5,32 @@ package seccomp import ( . "syscall" - "hakurei.app/container/comp" + "hakurei.app/container/std" ) -func Preset(presets comp.FilterPreset, flags ExportFlag) (rules []NativeRule) { +func Preset(presets std.FilterPreset, flags ExportFlag) (rules []NativeRule) { allowedPersonality := PersonaLinux - if presets&comp.PresetLinux32 != 0 { + if presets&std.PresetLinux32 != 0 { allowedPersonality = PersonaLinux32 } presetDevelFinal := presetDevel(ScmpDatum(allowedPersonality)) l := len(presetCommon) - if presets&comp.PresetDenyNS != 0 { + if presets&std.PresetDenyNS != 0 { l += len(presetNamespace) } - if presets&comp.PresetDenyTTY != 0 { + if presets&std.PresetDenyTTY != 0 { l += len(presetTTY) } - if presets&comp.PresetDenyDevel != 0 { + if presets&std.PresetDenyDevel != 0 { l += len(presetDevelFinal) } if flags&AllowMultiarch == 0 { l += len(presetEmu) } - if presets&comp.PresetExt != 0 { + if presets&std.PresetExt != 0 { l += len(presetCommonExt) - if presets&comp.PresetDenyNS != 0 { + if presets&std.PresetDenyNS != 0 { l += len(presetNamespaceExt) } if flags&AllowMultiarch == 0 { @@ -40,21 +40,21 @@ func Preset(presets comp.FilterPreset, flags ExportFlag) (rules []NativeRule) { rules = make([]NativeRule, 0, l) rules = append(rules, presetCommon...) - if presets&comp.PresetDenyNS != 0 { + if presets&std.PresetDenyNS != 0 { rules = append(rules, presetNamespace...) } - if presets&comp.PresetDenyTTY != 0 { + if presets&std.PresetDenyTTY != 0 { rules = append(rules, presetTTY...) } - if presets&comp.PresetDenyDevel != 0 { + if presets&std.PresetDenyDevel != 0 { rules = append(rules, presetDevelFinal...) } if flags&AllowMultiarch == 0 { rules = append(rules, presetEmu...) } - if presets&comp.PresetExt != 0 { + if presets&std.PresetExt != 0 { rules = append(rules, presetCommonExt...) - if presets&comp.PresetDenyNS != 0 { + if presets&std.PresetDenyNS != 0 { rules = append(rules, presetNamespaceExt...) } if flags&AllowMultiarch == 0 { |
