Disallow writing to empty paths (#5702)

This commit is contained in:
Vishal Nayak 2018-11-06 14:08:55 -05:00 committed by GitHub
parent 0974e52c24
commit 959a70e4a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,6 +167,10 @@ func (b *PassthroughBackend) GeneratesLeases() bool {
}
func (b *PassthroughBackend) handleWrite(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
if req.Path == "" {
return logical.ErrorResponse("missing path"), nil
}
// Check that some fields are given
if len(req.Data) == 0 {
return logical.ErrorResponse("missing data fields"), nil