Check ACL patterns for validity when loading.

Closes #1539. Thanks to Leon Poon.
This commit is contained in:
Roger A. Light 2019-12-18 21:39:27 +00:00
parent c8789180f3
commit b6119bb759
2 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Broker: Broker:
- Fix session expiry with very large expiry intervals. Closes #1525. - Fix session expiry with very large expiry intervals. Closes #1525.
- Check ACL patterns for validity when loading. Closes #1539.
1.6.8 - 20191128 1.6.8 - 20191128
================ ================

View File

@ -510,6 +510,14 @@ static int aclfile__parse(struct mosquitto_db *db, struct mosquitto__security_op
}else{ }else{
access = MOSQ_ACL_READ | MOSQ_ACL_WRITE; access = MOSQ_ACL_READ | MOSQ_ACL_WRITE;
} }
rc = mosquitto_sub_topic_check(topic);
if(rc != MOSQ_ERR_SUCCESS){
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid ACL topic \"%s\" in acl_file \"%s\".", topic, security_opts->acl_file);
mosquitto__free(user);
fclose(aclfptr);
return rc;
}
if(topic_pattern == 0){ if(topic_pattern == 0){
rc = add__acl(security_opts, user, topic, access); rc = add__acl(security_opts, user, topic, access);
}else{ }else{