Skip to content

Commit bfdefcf

Browse files
committed
setup: create the directory before we set landlock rules
Signed-off-by: Morten Linderud <[email protected]>
1 parent 12b3f72 commit bfdefcf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/sbctl/setup.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,14 @@ func SetupInstallation(state *config.State) error {
151151
}
152152

153153
func MigrateSetup(state *config.State) error {
154+
154155
newConf := config.DefaultConfig()
155156
p := path.Dir(newConf.Keydir)
156157

158+
if err := state.Fs.MkdirAll(p, os.ModePerm); err != nil {
159+
return err
160+
}
161+
157162
if state.Config.Landlock {
158163
lsm.RestrictAdditionalPaths(
159164
landlock.RWDirs(sbctl.DatabasePath),

0 commit comments

Comments
 (0)