Skip to content

Commit

Permalink
exec: use landlock only if it is available (#50)
Browse files Browse the repository at this point in the history
Fixes #49
  • Loading branch information
shoenig authored Mar 9, 2023
1 parent c4f2b5f commit cc4d3ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/command/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (e *exec) combine(local, gh *set.Set[ssh.Key]) []ssh.Key {
}

func lockdown(keyfile string) error {
ll := landlock.New(paths(keyfile)...)
return ll.Lock(landlock.OnlySupported)
if landlock.Available() {
ll := landlock.New(paths(keyfile)...)
return ll.Lock(landlock.OnlySupported)
}
return nil
}

0 comments on commit cc4d3ff

Please sign in to comment.