Skip to content

Commit

Permalink
fix GOOS=linux staticcheck errors
Browse files Browse the repository at this point in the history
related to #10
  • Loading branch information
stapelberg committed Feb 23, 2025
1 parent 99097a3 commit 8f73d56
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion internal/maincmd/namespacing.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !linux || nonamespacing
// +build !linux nonamespacing

package maincmd

Expand Down
1 change: 0 additions & 1 deletion internal/maincmd/namespacing_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build linux && !nonamespacing
// +build linux,!nonamespacing

package maincmd

Expand Down
2 changes: 2 additions & 0 deletions internal/maincmd/privdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ func dropPrivileges() error {

// Defense in depth: exit if we can re-gain uid/gid 0 permission:
if err := syscall.Setgid(0); err == nil {
//lint:ignore ST1005 we need this punctuation for dramatic effect!
return fmt.Errorf("unexpectedly able to re-gain gid 0 permission!")
}

if err := syscall.Setuid(0); err == nil {
//lint:ignore ST1005 we need this punctuation for dramatic effect!
return fmt.Errorf("unexpectedly able to re-gain uid 0 permission!")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/maincmd/unprivileged_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build linux
//go:build linux && nonamespacing

package maincmd

Expand Down

0 comments on commit 8f73d56

Please sign in to comment.