Просмотр исходного кода

coroparse: Don't allow sections within member

Solve problem with incorrect prefix if subsections were used.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Jan Friesse 9 месяцев назад
Родитель
Сommit
8100d953e0
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      exec/coroparse.c

+ 7 - 1
exec/coroparse.c

@@ -1058,7 +1058,7 @@ static int main_config_parser_cb(const char *path,
 			}
 			break;
 		case MAIN_CP_CB_DATA_STATE_MEMBER:
-			if (strcmp(key, "memberaddr") != 0) {
+			if (strcmp(path, "totem.interface.member.memberaddr") != 0) {
 				*error_string = "Only memberaddr is allowed in member section";
 
 				return (0);
@@ -1225,6 +1225,12 @@ static int main_config_parser_cb(const char *path,
 
 			return (0);
 		};
+
+		if (*state == MAIN_CP_CB_DATA_STATE_MEMBER && strcmp(path, "totem.interface.member") != 0) {
+			*error_string = "Subsections are not allowed within totem.interface.member section";
+
+			return (0);
+		};
 		break;
 	case PARSER_CB_SECTION_END:
 		switch (*state) {