diff --git a/src/libnm-client-impl/nm-vpn-service-plugin.c b/src/libnm-client-impl/nm-vpn-service-plugin.c index 5c7bc45b6d..7ed0c5fabe 100644 --- a/src/libnm-client-impl/nm-vpn-service-plugin.c +++ b/src/libnm-client-impl/nm-vpn-service-plugin.c @@ -807,29 +807,23 @@ nm_vpn_service_plugin_read_vpn_details(int fd, GHashTable **out_data, GHashTable /* finish marker */ break; } else if (NM_STR_HAS_PREFIX(line->str, DATA_KEY_TAG)) { - if (nm_clear_g_string(&key)) - g_warning("a value expected"); + nm_clear_g_string(&key); key = g_string_new(line->str + strlen(DATA_KEY_TAG)); str = key; hash = data; } else if (NM_STR_HAS_PREFIX(line->str, DATA_VAL_TAG)) { - if (val || !key || hash != data) { - g_warning("%s not preceded by %s", DATA_VAL_TAG, DATA_KEY_TAG); + if (val || !key || hash != data) break; - } val = g_string_new(line->str + strlen(DATA_VAL_TAG)); str = val; } else if (NM_STR_HAS_PREFIX(line->str, SECRET_KEY_TAG)) { - if (nm_clear_g_string(&key)) - g_warning("a value expected"); + nm_clear_g_string(&key); key = g_string_new(line->str + strlen(SECRET_KEY_TAG)); str = key; hash = secrets; } else if (NM_STR_HAS_PREFIX(line->str, SECRET_VAL_TAG)) { - if (val || !key || hash != secrets) { - g_warning("%s not preceded by %s", SECRET_VAL_TAG, SECRET_KEY_TAG); + if (val || !key || hash != secrets) break; - } val = g_string_new(line->str + strlen(SECRET_VAL_TAG)); str = val; } diff --git a/src/libnm-client-impl/tests/test-libnm.c b/src/libnm-client-impl/tests/test-libnm.c index 003b030432..d09feb5ce3 100644 --- a/src/libnm-client-impl/tests/test-libnm.c +++ b/src/libnm-client-impl/tests/test-libnm.c @@ -2462,8 +2462,7 @@ test_nm_vpn_service_plugin_read_vpn_details(void) "DONE\n" "", READ_VPN_DETAIL_DATA({"some-key", "string\ncontinued after a line break"}, ), - READ_VPN_DETAIL_DATA({"key names\ncan have\ncontinuations too", "value"}, ), - NMTST_EXPECT_LIBNM_WARNING("DATA_VAL= not preceded by DATA_KEY=")); + READ_VPN_DETAIL_DATA({"key names\ncan have\ncontinuations too", "value"}, ), ); _do_read_vpn_details( ""