mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
Harden mount/auth filter evaluation error handling (#7754)
This commit is contained in:
parent
33bf63ab06
commit
706e2b5f09
@ -56,6 +56,11 @@ func (c *Core) enableCredential(ctx context.Context, entry *MountEntry) error {
|
||||
// Re-evaluate filtered paths
|
||||
if err := runFilteredPathsEvaluation(ctx, c); err != nil {
|
||||
c.logger.Error("failed to evaluate filtered paths", "error", err)
|
||||
|
||||
// We failed to evaluate filtered paths so we are undoing the mount operation
|
||||
if disableCredentialErr := c.disableCredentialInternal(ctx, entry.Path, MountTableUpdateStorage); disableCredentialErr != nil {
|
||||
c.logger.Error("failed to disable credential", "error", disableCredentialErr)
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@ -383,6 +383,11 @@ func (c *Core) mount(ctx context.Context, entry *MountEntry) error {
|
||||
// Re-evaluate filtered paths
|
||||
if err := runFilteredPathsEvaluation(ctx, c); err != nil {
|
||||
c.logger.Error("failed to evaluate filtered paths", "error", err)
|
||||
|
||||
// We failed to evaluate filtered paths so we are undoing the mount operation
|
||||
if unmountInternalErr := c.unmountInternal(ctx, entry.Path, MountTableUpdateStorage); unmountInternalErr != nil {
|
||||
c.logger.Error("failed to unmount", "error", unmountInternalErr)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user