Skip to content

Commit

Permalink
incusd/daemon: Handle authorization scriptlet reset
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
  • Loading branch information
bensmrs committed Nov 22, 2024
1 parent 2d5e177 commit 16c113b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/incusd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,15 @@ func (d *Daemon) setupAuthorizationScriptlet(scriptlet string) error {
return fmt.Errorf("Failed saving authorization scriptlet: %w", err)
}

if scriptlet != "" {
if scriptlet == "" {
// Reset to default authorizer.
d.authorizer, err = auth.LoadAuthorizer(d.shutdownCtx, auth.DriverTLS, logger.Log, d.clientCerts)
if err != nil {
return err
}

return nil
} else {
// Fail if not using the default tls or scriptlet authorizer.
switch d.authorizer.(type) {
case *auth.TLS, *auth.Scriptlet:
Expand Down

0 comments on commit 16c113b

Please sign in to comment.