Преглед изворни кода

logconfig: Do not overwrite logger_subsys priority

logfile_priority and syslog_priority could be modified by
logging.logger_subsys.{logfile_priority|syslog_priority}. which could
lead to the following output(which are at notice level):

corosync[21419]:   [QUORUM] Using quorum provider corosync_votequorum
corosync[21419]:   [QUORUM] Members[1]: 1084777643
corosync[21419]:   [QUORUM] This node is within the primary component
                   and will provide service.
corosync[21419]:   [QUORUM] Members[3]: 1084777563 1084777584 1084777643

even the syslog_priority is warning. This patch could avoid the
overwrite.

Signed-off-by: Bin Liu <bliu@suse.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Bin Liu пре 9 година
родитељ
комит
d2a5e1442e
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      exec/logconfig.c

+ 2 - 2
exec/logconfig.c

@@ -401,7 +401,7 @@ static int corosync_main_config_set (
 			goto parse_error;
 			goto parse_error;
 		}
 		}
 	}
 	}
-	else {
+	else if(strcmp(key_name, "logging.syslog_priority") == 0){
 		if (logsys_config_syslog_priority_set(subsys,
 		if (logsys_config_syslog_priority_set(subsys,
 						      logsys_priority_id_get("info")) < 0) {
 						      logsys_priority_id_get("info")) < 0) {
 			error_reason = "unable to set syslog level";
 			error_reason = "unable to set syslog level";
@@ -449,7 +449,7 @@ static int corosync_main_config_set (
 			goto parse_error;
 			goto parse_error;
 		}
 		}
 	}
 	}
-	else {
+	else if(strcmp(key_name,"logging.logfile_priority") == 0){
 		if (logsys_config_logfile_priority_set(subsys,
 		if (logsys_config_logfile_priority_set(subsys,
 						      logsys_priority_id_get("info")) < 0) {
 						      logsys_priority_id_get("info")) < 0) {
 			error_reason = "unable to set syslog level";
 			error_reason = "unable to set syslog level";