Skip to content

Commit

Permalink
setup: create the directory before we set landlock rules
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Linderud <[email protected]>
  • Loading branch information
Foxboron committed Jul 31, 2024
1 parent 12b3f72 commit bfdefcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/sbctl/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,14 @@ func SetupInstallation(state *config.State) error {
}

func MigrateSetup(state *config.State) error {

newConf := config.DefaultConfig()
p := path.Dir(newConf.Keydir)

if err := state.Fs.MkdirAll(p, os.ModePerm); err != nil {
return err
}

if state.Config.Landlock {
lsm.RestrictAdditionalPaths(
landlock.RWDirs(sbctl.DatabasePath),
Expand Down

0 comments on commit bfdefcf

Please sign in to comment.