read_full_config error can't abort maat_new
This commit is contained in:
@@ -387,7 +387,6 @@ struct maat *maat_new(struct maat_options *opts, const char *table_info_path)
|
||||
if (ret < 0) {
|
||||
log_error(maat_instance->logger, MODULE_MAAT_API,
|
||||
"[%s:%d] maat read full config failed", __FUNCTION__, __LINE__);
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -435,8 +435,8 @@ int load_maat_json_file(struct maat *maat_instance, const char *json_filename,
|
||||
}
|
||||
|
||||
if (!maat_instance->is_running) {
|
||||
strncpy(maat_instance->json_ctx.json_file, json_filename,
|
||||
sizeof(maat_instance->json_ctx.json_file));
|
||||
size_t len = MIN(strlen(json_filename), sizeof(maat_instance->json_ctx.json_file));
|
||||
strncpy(maat_instance->json_ctx.json_file, json_filename, len);
|
||||
}
|
||||
|
||||
ret = stat(json_filename, &fstat_buf);
|
||||
|
||||
@@ -478,10 +478,8 @@ void *rule_monitor_loop(void *arg)
|
||||
ret = maat_read_full_config(maat_instance);
|
||||
if (ret < 0) {
|
||||
log_error(maat_instance->logger, MODULE_MAAT_RULE,
|
||||
"[%s:%d] maat read full config failed, exit rule_monitor_loop thread.",
|
||||
"[%s:%d] maat read full config failed",
|
||||
__FUNCTION__, __LINE__);
|
||||
pthread_mutex_unlock(&(maat_instance->background_update_mutex));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&(maat_instance->background_update_mutex));
|
||||
|
||||
Reference in New Issue
Block a user