Fix panic if passing "rules" via sys/policies/acl (#4705)

This commit is contained in:
Jeff Mitchell 2018-06-05 13:01:55 -04:00 committed by GitHub
parent 8df30fc414
commit 4e71de3393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2610,7 +2610,7 @@ func (b *SystemBackend) handlePoliciesSet(policyType PolicyType) framework.Opera
}
policy.Raw = data.Get("policy").(string)
if policy.Raw == "" {
if policy.Raw == "" && policyType == PolicyTypeACL && strings.HasPrefix(req.Path, "policy") {
policy.Raw = data.Get("rules").(string)
if resp == nil {
resp = &logical.Response{}