|
|
|
@ -392,7 +392,6 @@ int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config
|
|
|
|
|
db->config_file = argv[i+1];
|
|
|
|
|
|
|
|
|
|
if(config__read(db, config, false)){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open configuration file.");
|
|
|
|
|
return MOSQ_ERR_INVAL;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
@ -618,7 +617,9 @@ int config__read(struct mosquitto_db *db, struct mosquitto__config *config, bool
|
|
|
|
|
rc = config__read_file(config, reload, db->config_file, &cr, 0, &lineno);
|
|
|
|
|
}
|
|
|
|
|
if(rc){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", db->config_file, lineno);
|
|
|
|
|
if(lineno > 0){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", db->config_file, lineno);
|
|
|
|
|
}
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -695,11 +696,11 @@ int config__read(struct mosquitto_db *db, struct mosquitto__config *config, bool
|
|
|
|
|
}
|
|
|
|
|
#ifdef FINAL_WITH_TLS_PSK
|
|
|
|
|
if(config->bridges[i].tls_psk && !config->bridges[i].tls_psk_identity){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_identity.\n");
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_identity.");
|
|
|
|
|
return MOSQ_ERR_INVAL;
|
|
|
|
|
}
|
|
|
|
|
if(config->bridges[i].tls_psk_identity && !config->bridges[i].tls_psk){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_psk.\n");
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration: missing bridge_psk.");
|
|
|
|
|
return MOSQ_ERR_INVAL;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
@ -1221,7 +1222,9 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct
|
|
|
|
|
|
|
|
|
|
rc = config__read_file(config, reload, files[i], cr, level+1, &lineno_ext);
|
|
|
|
|
if(rc){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", files[i], lineno_ext);
|
|
|
|
|
if(lineno_ext > 0){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error found at %s:%d.", files[i], lineno_ext);
|
|
|
|
|
}
|
|
|
|
|
/* Free happens below */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -2017,7 +2020,7 @@ int config__read_file(struct mosquitto__config *config, bool reload, const char
|
|
|
|
|
|
|
|
|
|
fptr = mosquitto__fopen(file, "rt", false);
|
|
|
|
|
if(!fptr){
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open config file %s\n", file);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_ERR, "Error: Unable to open config file %s.", file);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|