Commit 576cbb77 authored by Thomas Haller's avatar Thomas Haller

libnm: always return VPN connections's banner

It's not libnm's responsibility to hide the banner
depending on the VPN state. libnm should cache and expose
NetworkManager's state, and if the VPN connection has
a banner there, it should be returned.

The previous behavior was since ever in libnm, and in libnm-glib since
the banner was introduced in commit e5b834c1.
I think it's wrong if libnm tries too hard putting additional logic
on top of what is on D-Bus.
parent 4e7ae3da
......@@ -2,7 +2,7 @@ location: clients/tests/test-client.py:945:test_004()/21
cmd: $NMCLI con s con-vpn-1
lang: C
returncode: 0
stdout: 4326 bytes
stdout: 4356 bytes
>>>
connection.id: con-vpn-1
connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP
......@@ -90,7 +90,7 @@ GENERAL.MASTER-PATH: --
VPN.TYPE: openvpn
VPN.USERNAME: --
VPN.GATEWAY: --
VPN.BANNER: --
VPN.BANNER: *** VPN connection con-vpn-1 ***
VPN.VPN-STATE: 0 - unknown
VPN.CFG[1]: key1 = val1
VPN.CFG[2]: key2 = val2
......
......@@ -2,7 +2,7 @@ location: clients/tests/test-client.py:945:test_004()/22
cmd: $NMCLI con s con-vpn-1
lang: pl_PL.UTF-8
returncode: 0
stdout: 4340 bytes
stdout: 4370 bytes
>>>
connection.id: con-vpn-1
connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP
......@@ -90,7 +90,7 @@ GENERAL.MASTER-PATH: --
VPN.TYPE: openvpn
VPN.USERNAME: --
VPN.GATEWAY: --
VPN.BANNER: --
VPN.BANNER: *** VPN connection con-vpn-1 ***
VPN.VPN-STATE: 0 - nieznane
VPN.CFG[1]: key1 = val1
VPN.CFG[2]: key2 = val2
......
......@@ -71,16 +71,9 @@ static guint signals[LAST_SIGNAL] = { 0 };
const char *
nm_vpn_connection_get_banner (NMVpnConnection *vpn)
{
NMVpnConnectionPrivate *priv;
g_return_val_if_fail (NM_IS_VPN_CONNECTION (vpn), NULL);
priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn);
if (priv->vpn_state != NM_VPN_CONNECTION_STATE_ACTIVATED)
return NULL;
return nm_str_not_empty (priv->banner);
return nm_str_not_empty (NM_VPN_CONNECTION_GET_PRIVATE (vpn)->banner);
}
/**
......
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