Skip to content

Commit f33da4d

Browse files
thaJeztahpcmoore
authored andcommitted
Deprecate ActKill in favor of ActKillThread
Signed-off-by: Sebastiaan van Stijn <[email protected]> Acked-by: Tom Hromatka <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent c35397d commit f33da4d

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

seccomp.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ const (
182182
// ActInvalid is a placeholder to ensure uninitialized ScmpAction
183183
// variables are invalid
184184
ActInvalid ScmpAction = iota
185-
// ActKill kills the thread that violated the rule. It is the same as ActKillThread.
185+
// ActKillThread kills the thread that violated the rule.
186186
// All other threads from the same thread group will continue to execute.
187-
ActKill
187+
ActKillThread
188188
// ActTrap throws SIGSYS
189189
ActTrap
190190
// ActNotify triggers a userspace notification. This action is only usable when
@@ -207,9 +207,11 @@ const (
207207
// This action is only usable when libseccomp API level 3 or higher is
208208
// supported.
209209
ActKillProcess
210-
// ActKillThread kills the thread that violated the rule. It is the same as ActKill.
210+
// ActKill kills the thread that violated the rule.
211211
// All other threads from the same thread group will continue to execute.
212-
ActKillThread = ActKill
212+
//
213+
// Deprecated: use ActKillThread
214+
ActKill = ActKillThread
213215
)
214216

215217
const (

seccomp_internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ const (
293293
archStart ScmpArch = ArchNative
294294
archEnd ScmpArch = ArchRISCV64
295295
// Comparison boundaries to check for action validity
296-
actionStart ScmpAction = ActKill
296+
actionStart ScmpAction = ActKillThread
297297
actionEnd ScmpAction = ActKillProcess
298298
// Comparison boundaries to check for comparison operator validity
299299
compareOpStart ScmpCompareOp = CompareNotEqual

seccomp_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func TestFilterCreateRelease(t *testing.T) {
274274
t.Errorf("Can create filter with invalid action")
275275
}
276276

277-
filter, err := NewFilter(ActKill)
277+
filter, err := NewFilter(ActKillThread)
278278
if err != nil {
279279
t.Errorf("Error creating filter: %s", err)
280280
}
@@ -291,7 +291,7 @@ func TestFilterCreateRelease(t *testing.T) {
291291
}
292292

293293
func TestFilterReset(t *testing.T) {
294-
filter, err := NewFilter(ActKill)
294+
filter, err := NewFilter(ActKillThread)
295295
if err != nil {
296296
t.Errorf("Error creating filter: %s", err)
297297
}
@@ -301,7 +301,7 @@ func TestFilterReset(t *testing.T) {
301301
action, err := filter.GetDefaultAction()
302302
if err != nil {
303303
t.Errorf("Error getting default action of filter")
304-
} else if action != ActKill {
304+
} else if action != ActKillThread {
305305
t.Errorf("Default action of filter was set incorrectly!")
306306
}
307307

@@ -326,7 +326,7 @@ func TestFilterReset(t *testing.T) {
326326
}
327327

328328
func TestFilterArchFunctions(t *testing.T) {
329-
filter, err := NewFilter(ActKill)
329+
filter, err := NewFilter(ActKillThread)
330330
if err != nil {
331331
t.Errorf("Error creating filter: %s", err)
332332
}
@@ -402,7 +402,7 @@ func TestFilterArchFunctions(t *testing.T) {
402402
}
403403

404404
func TestFilterAttributeGettersAndSetters(t *testing.T) {
405-
filter, err := NewFilter(ActKill)
405+
filter, err := NewFilter(ActKillThread)
406406
if err != nil {
407407
t.Errorf("Error creating filter: %s", err)
408408
}
@@ -411,7 +411,7 @@ func TestFilterAttributeGettersAndSetters(t *testing.T) {
411411
act, err := filter.GetDefaultAction()
412412
if err != nil {
413413
t.Errorf("Error getting default action: %s", err)
414-
} else if act != ActKill {
414+
} else if act != ActKillThread {
415415
t.Errorf("Default action was set incorrectly")
416416
}
417417

@@ -547,7 +547,7 @@ func TestMergeFilters(t *testing.T) {
547547
t.Errorf("Source filter should not be valid after merging")
548548
}
549549

550-
filter3, err := NewFilter(ActKill)
550+
filter3, err := NewFilter(ActKillThread)
551551
if err != nil {
552552
t.Errorf("Error creating filter: %s", err)
553553
}

0 commit comments

Comments
 (0)