Skip to content

Commit

Permalink
Fix HelpOperation on sudo-protected paths (#18568)
Browse files Browse the repository at this point in the history
* Fix HelpOperation on sudo-protected paths

Fixes #18566

* Add changelog
  • Loading branch information
maxb committed Jan 10, 2023
1 parent 1fca38a commit 4758cc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/18568.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core: Fix spurious `permission denied` for all HelpOperations on sudo-protected paths
```
4 changes: 3 additions & 1 deletion vault/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ func (c *Core) performPolicyChecks(ctx context.Context, acl *ACL, te *logical.To
if !ret.ACLResults.Allowed {
return ret
}
if !ret.RootPrivs && opts.RootPrivsRequired {
// Since HelpOperation was fast-pathed inside AllowOperation, RootPrivs will not have been populated in this
// case, so we need to special-case that here as well, or we'll block HelpOperation on all sudo-protected paths.
if !ret.RootPrivs && opts.RootPrivsRequired && req.Operation != logical.HelpOperation {
return ret
}
}
Expand Down

0 comments on commit 4758cc8

Please sign in to comment.