Commit 8f37efe9 authored by Aaron Barany's avatar Aaron Barany
Browse files

Forward opeconnect usergroup

Forward the usergroup for openconnect (provided by the URL path) to the
NetworkManager service by incorporating it in NM_OPENCONNECT_KEY_GATEWAY.
This ensures that the VPN session in the NetworkManager service uses the
same usergroup as provided with the gateway when the initial connection
was made through the UI.

BUG: 435561
parent fa1d779e
......@@ -383,7 +383,13 @@ QVariantMap OpenconnectAuthWidget::setting() const
secrets.unite(d->secrets);
QString host(openconnect_get_hostname(d->vpninfo));
const QString port = QString::number(openconnect_get_port(d->vpninfo));
secrets.insert(QLatin1String(NM_OPENCONNECT_KEY_GATEWAY), host + ':' + port);
QString gateway = host + ':' + port;
const char* urlpath = openconnect_get_urlpath(d->vpninfo);
if (urlpath) {
gateway += '/';
gateway += urlpath;
}
secrets.insert(QLatin1String(NM_OPENCONNECT_KEY_GATEWAY), gateway);
secrets.insert(QLatin1String(NM_OPENCONNECT_KEY_COOKIE), QLatin1String(openconnect_get_cookie(d->vpninfo)));
openconnect_clear_cookie(d->vpninfo);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment