mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-17 06:50:38 +02:00
clients,vpn: only accept full service-types in nm_vpn_get_secret_names()
nm_vpn_get_secret_names() has only one caller, which passes nm_setting_vpn_get_service_type() as @vpn_type argument. That argument is not a short-name or abbreviation, it must be the full service-type. For our well-known, hard-coded list of service-types, all must start with the same prefix.
This commit is contained in:
parent
59269b6925
commit
7e0660bf07
1 changed files with 6 additions and 4 deletions
|
|
@ -135,11 +135,13 @@ nm_vpn_get_secret_names (const char *vpn_type)
|
|||
if (!vpn_type)
|
||||
return NULL;
|
||||
|
||||
if (g_str_has_prefix (vpn_type, NM_DBUS_INTERFACE))
|
||||
type = vpn_type + strlen (NM_DBUS_INTERFACE) + 1;
|
||||
else
|
||||
type = vpn_type;
|
||||
if ( !g_str_has_prefix (vpn_type, NM_DBUS_INTERFACE)
|
||||
|| vpn_type[NM_STRLEN (NM_DBUS_INTERFACE)] != '.') {
|
||||
/* all our well-known, hard-coded vpn-types start with NM_DBUS_INTERFACE. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
type = vpn_type + (NM_STRLEN (NM_DBUS_INTERFACE) + 1);
|
||||
if ( !g_strcmp0 (type, "pptp")
|
||||
|| !g_strcmp0 (type, "iodine")
|
||||
|| !g_strcmp0 (type, "ssh")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue