From 07847db961ef6b2f93fc95de779b3b87d72eb8df Mon Sep 17 00:00:00 2001 From: Vishal Nayak Date: Thu, 29 Oct 2020 14:31:58 -0400 Subject: [PATCH] Fix remount tests (#10265) --- vault/logical_system.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vault/logical_system.go b/vault/logical_system.go index 46b22bc09d..647f9886db 100644 --- a/vault/logical_system.go +++ b/vault/logical_system.go @@ -1018,7 +1018,12 @@ func (b *SystemBackend) handleUnmount(ctx context.Context, req *logical.Request, } func validateMountPath(p string) error { + hasSuffix := strings.HasSuffix(p, "/") s := path.Clean(p) + // Retain the trailing slash if it was provided + if hasSuffix { + s = s + "/" + } if p != s { return fmt.Errorf("path '%v' does not match cleaned path '%v'", p, s) }