File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed
Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -444,25 +444,8 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
444444 })
445445 }
446446
447- // make a map of enabled capabilities
448- caps := make (map [string ]bool )
447+ admin := false
449448 for _ , c := range sp .Process .Capabilities .Bounding {
450- caps [c ] = true
451- }
452- for _ , c := range sp .Process .Capabilities .Effective {
453- caps [c ] = true
454- }
455- for _ , c := range sp .Process .Capabilities .Inheritable {
456- caps [c ] = true
457- }
458- for _ , c := range sp .Process .Capabilities .Permitted {
459- caps [c ] = true
460- }
461- for _ , c := range sp .Process .Capabilities .Ambient {
462- caps [c ] = true
463- }
464-
465- for c := range caps {
466449 switch c {
467450 case "CAP_DAC_READ_SEARCH" :
468451 s .Syscalls = append (s .Syscalls , specs.LinuxSyscall {
@@ -471,6 +454,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
471454 Args : []specs.LinuxSeccompArg {},
472455 })
473456 case "CAP_SYS_ADMIN" :
457+ admin = true
474458 s .Syscalls = append (s .Syscalls , specs.LinuxSyscall {
475459 Names : []string {
476460 "bpf" ,
@@ -558,7 +542,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
558542 }
559543 }
560544
561- if ! caps [ "CAP_SYS_ADMIN" ] {
545+ if ! admin {
562546 switch runtime .GOARCH {
563547 case "s390" , "s390x" :
564548 s .Syscalls = append (s .Syscalls , specs.LinuxSyscall {
You can’t perform that action at this time.
0 commit comments