Skip to content

Commit

Permalink
Fix crash when landlock ABI is outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
pufferffish committed Apr 13, 2024
1 parent f54319b commit d40aa7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/wireproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func lock(stage string) {
// also remove unveil permission to lock unveil
pledgeOrPanic("stdio rpath inet dns proc exec")
// Linux
panicIfError(landlock.V4.BestEffort().RestrictPaths(
panicIfError(landlock.V1.BestEffort().RestrictPaths(
landlock.RODirs("/"),
))
case "boot-daemon":
Expand All @@ -75,7 +75,7 @@ func lock(stage string) {
pledgeOrPanic("stdio inet dns")
// Linux
net.DefaultResolver.PreferGo = true // needed to lock down dependencies
panicIfError(landlock.V4.BestEffort().RestrictPaths(
panicIfError(landlock.V1.BestEffort().RestrictPaths(
landlock.ROFiles("/etc/resolv.conf"),
landlock.ROFiles("/dev/fd"),
landlock.ROFiles("/dev/zero"),
Expand Down Expand Up @@ -136,7 +136,7 @@ func lockNetwork(sections []wireproxy.RoutineSpawner, infoAddr *string) {
}
}

panicIfError(landlock.V4.RestrictNet(rules...))
panicIfError(landlock.V4.BestEffort().RestrictNet(rules...))
}

func main() {
Expand Down

0 comments on commit d40aa7f

Please sign in to comment.