mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 06:30:21 +01:00
core,cli,agent-mangager: merge branch 'lr/vpn-fixes'
Various VPN-related fixes. https://bugzilla.gnome.org/show_bug.cgi?id=740525
This commit is contained in:
commit
d9806a9cae
6 changed files with 35 additions and 5 deletions
|
|
@ -497,13 +497,15 @@ NmcOutputField nmc_fields_setting_vpn[] = {
|
|||
SETTING_FIELD (NM_SETTING_VPN_USER_NAME, 12), /* 2 */
|
||||
SETTING_FIELD (NM_SETTING_VPN_DATA, 30), /* 3 */
|
||||
SETTING_FIELD (NM_SETTING_VPN_SECRETS, 15), /* 4 */
|
||||
SETTING_FIELD (NM_SETTING_VPN_PERSISTENT, 15), /* 5 */
|
||||
{NULL, NULL, 0, NULL, FALSE, FALSE, 0}
|
||||
};
|
||||
#define NMC_FIELDS_SETTING_VPN_ALL "name"","\
|
||||
NM_SETTING_VPN_SERVICE_TYPE","\
|
||||
NM_SETTING_VPN_USER_NAME","\
|
||||
NM_SETTING_VPN_DATA","\
|
||||
NM_SETTING_VPN_SECRETS
|
||||
NM_SETTING_VPN_SECRETS","\
|
||||
NM_SETTING_VPN_PERSISTENT
|
||||
#define NMC_FIELDS_SETTING_VPN_COMMON NMC_FIELDS_SETTING_VPN_ALL
|
||||
|
||||
/* Available fields for NM_SETTING_WIMAX_SETTING_NAME */
|
||||
|
|
@ -1450,6 +1452,8 @@ nmc_property_vpn_get_secrets (NMSetting *setting)
|
|||
return g_string_free (secret_str, FALSE);
|
||||
}
|
||||
|
||||
DEFINE_GETTER (nmc_property_vpn_get_persistent, NM_SETTING_VPN_PERSISTENT)
|
||||
|
||||
/* --- NM_SETTING_WIMAX_SETTING_NAME property get functions --- */
|
||||
DEFINE_GETTER (nmc_property_wimax_get_network_name, NM_SETTING_WIMAX_NETWORK_NAME)
|
||||
DEFINE_GETTER (nmc_property_wimax_get_mac_address, NM_SETTING_WIMAX_MAC_ADDRESS)
|
||||
|
|
@ -5930,6 +5934,13 @@ nmc_properties_init (void)
|
|||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
nmc_add_prop_funcs (GLUE (VPN, PERSISTENT),
|
||||
nmc_property_vpn_get_persistent,
|
||||
nmc_property_set_bool,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Add editable properties for NM_SETTING_WIMAX_SETTING_NAME */
|
||||
nmc_add_prop_funcs (GLUE (WIMAX, NETWORK_NAME),
|
||||
|
|
@ -7076,6 +7087,7 @@ setting_vpn_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboo
|
|||
set_val_str (arr, 2, nmc_property_vpn_get_user_name (setting));
|
||||
set_val_str (arr, 3, nmc_property_vpn_get_data (setting));
|
||||
set_val_str (arr, 4, GET_SECRET (secrets, setting, nmc_property_vpn_get_secrets));
|
||||
set_val_str (arr, 5, nmc_property_vpn_get_persistent (setting));
|
||||
g_ptr_array_add (nmc->output_data, arr);
|
||||
|
||||
print_data (nmc); /* Print all data */
|
||||
|
|
|
|||
|
|
@ -571,6 +571,8 @@ typedef enum {
|
|||
* results or carrier changes.
|
||||
* @NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM: Internal flag, not part of
|
||||
* the D-Bus API.
|
||||
* @NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS: Internal flag, not part of
|
||||
* the D-Bus API.
|
||||
*
|
||||
* #NMSecretAgentGetSecretsFlags values modify the behavior of a GetSecrets request.
|
||||
*
|
||||
|
|
@ -583,7 +585,8 @@ typedef enum { /*< flags >*/
|
|||
NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED = 0x4,
|
||||
|
||||
/* Internal to NM; not part of the D-Bus API */
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM = 0x80000000
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM = 0x80000000,
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS = 0x40000000,
|
||||
} NMSecretAgentGetSecretsFlags;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -920,6 +920,7 @@ nm_secret_agent_old_get_secrets (NMSecretAgentOld *self,
|
|||
g_return_if_fail (setting_name != NULL);
|
||||
g_return_if_fail (strlen (setting_name) > 0);
|
||||
g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM));
|
||||
g_return_if_fail (!(flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS));
|
||||
g_return_if_fail (callback != NULL);
|
||||
|
||||
NM_SECRET_AGENT_OLD_GET_CLASS (self)->get_secrets (self,
|
||||
|
|
|
|||
|
|
@ -1107,7 +1107,13 @@ get_start (gpointer user_data)
|
|||
req, parent->detail, req->setting_name);
|
||||
|
||||
/* We don't, so ask some agents for additional secrets */
|
||||
request_next_agent (parent);
|
||||
if ( req->flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS
|
||||
&& !parent->pending) {
|
||||
/* The request initiated from GetSecrets() via DBus,
|
||||
* don't error out if any secrets are missing. */
|
||||
req_complete_success (parent, req->existing_secrets, NULL, NULL);
|
||||
} else
|
||||
request_next_agent (parent);
|
||||
}
|
||||
}
|
||||
g_variant_unref (secrets_dict);
|
||||
|
|
|
|||
|
|
@ -299,8 +299,9 @@ nm_secret_agent_get_secrets (NMSecretAgent *self,
|
|||
hash = nm_utils_connection_dict_to_hash (dict);
|
||||
g_variant_unref (dict);
|
||||
|
||||
/* Mask off the private ONLY_SYSTEM flag if present */
|
||||
/* Mask off the private flags if present */
|
||||
flags &= ~NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM;
|
||||
flags &= ~NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS;
|
||||
|
||||
r = request_new (self, nm_connection_get_path (connection), setting_name, callback, callback_data);
|
||||
r->call = dbus_g_proxy_begin_call_with_timeout (priv->proxy,
|
||||
|
|
|
|||
|
|
@ -1229,6 +1229,12 @@ has_some_secrets_cb (NMSetting *setting,
|
|||
{
|
||||
GParamSpec *pspec;
|
||||
|
||||
if (NM_IS_SETTING_VPN (setting)) {
|
||||
if (nm_setting_vpn_get_num_secrets (NM_SETTING_VPN(setting)))
|
||||
*((gboolean *) user_data) = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (G_OBJECT (setting)), key);
|
||||
if (pspec) {
|
||||
if ( (flags & NM_SETTING_PARAM_SECRET)
|
||||
|
|
@ -1604,7 +1610,8 @@ dbus_get_secrets_auth_cb (NMSettingsConnection *self,
|
|||
call_id = nm_settings_connection_get_secrets (self,
|
||||
subject,
|
||||
setting_name,
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED,
|
||||
NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED
|
||||
| NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS,
|
||||
NULL,
|
||||
dbus_get_agent_secrets_cb,
|
||||
context,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue