diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-08-14 15:36:44 +0200 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2018-09-12 17:14:36 +0000 |
commit | 6e84f3d45934e4f1e334c4bfd0d9a43d88889039 (patch) | |
tree | 31acc1e5dec441b3cda6fd35a4739bf5a942dff6 /src/mm-iface-modem-location.c | |
parent | 47ed19d5be68f139d4fbb00c997cd2805488ace7 (diff) | |
download | ModemManager-6e84f3d45934e4f1e334c4bfd0d9a43d88889039.tar.gz |
iface-modem-location: validate SUPL server address
Devices will expect SUPL server given as either IP:PORT or FQDN:PORT,
so just avoid saying we require a 'URL' because it's not true.
We will use a new helper method to parse and validate user-provided
SUPL server address.
Diffstat (limited to 'src/mm-iface-modem-location.c')
-rw-r--r-- | src/mm-iface-modem-location.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mm-iface-modem-location.c b/src/mm-iface-modem-location.c index e5aaa43d2..88fd2bf82 100644 --- a/src/mm-iface-modem-location.c +++ b/src/mm-iface-modem-location.c @@ -21,6 +21,7 @@ #include "mm-iface-modem.h" #include "mm-iface-modem-location.h" #include "mm-log.h" +#include "mm-modem-helpers.h" #define MM_LOCATION_GPS_REFRESH_TIME_SECS 30 @@ -992,6 +993,13 @@ handle_set_supl_server_auth_ready (MMBaseModem *self, return; } + /* Validate SUPL address string: either FQDN:PORT or IP:PORT */ + if (!mm_parse_supl_address (ctx->supl, NULL, NULL, NULL, &error)) { + g_dbus_method_invocation_return_gerror (ctx->invocation, error); + handle_set_supl_server_context_free (ctx); + return; + } + /* Check if plugin implements it */ if (!MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->set_supl_server || !MM_IFACE_MODEM_LOCATION_GET_INTERFACE (self)->set_supl_server_finish) { |