[PATCH] accept full urls in nm-auth-dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



E.g. "<host>:<port>" will now work.
---
 nm-auth-dialog.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/nm-auth-dialog.c b/nm-auth-dialog.c
index f173212..ae0fc22 100644
--- a/nm-auth-dialog.c
+++ b/nm-auth-dialog.c
@@ -1193,8 +1193,15 @@ static void connect_host(auth_ui_data *ui_data)
 	for (i = 0; i < host_nr; i++)
 		host = host->next;
 
-	ui_data->vpninfo->hostname = g_strdup(host->hostaddress);
-	if (host->usergroup)
+	if (parse_url(host->hostaddress, NULL,
+		      &ui_data->vpninfo->hostname, &ui_data->vpninfo->port,
+		      &ui_data->vpninfo->urlpath, 443)) {
+		fprintf(stderr, "Failed to parse server URL '%s'\n",
+			host->hostaddress);
+		ui_data->vpninfo->hostname = g_strdup(host->hostaddress);
+	}
+
+	if (!ui_data->vpninfo->urlpath && host->usergroup)
 		ui_data->vpninfo->urlpath = g_strdup(host->usergroup);
 
 	remember_gconf_key(ui_data, g_strdup("lasthost"), g_strdup(host->hostname));
-- 
1.6.6.1


--------------010008010909010609040602--



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux