mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-12 16:10:16 +01:00
supplicant: use connection UUID instead of D-Bus path for config purposes
This commit is contained in:
parent
847edde23a
commit
ba977b6a91
4 changed files with 22 additions and 22 deletions
|
|
@ -858,21 +858,21 @@ time_out:
|
|||
static NMSupplicantConfig *
|
||||
build_supplicant_config (NMDeviceEthernet *self)
|
||||
{
|
||||
const char *con_path;
|
||||
const char *con_uuid;
|
||||
NMSupplicantConfig *config = NULL;
|
||||
NMSetting8021x *security;
|
||||
NMConnection *connection;
|
||||
|
||||
connection = nm_device_get_connection (NM_DEVICE (self));
|
||||
g_return_val_if_fail (connection, NULL);
|
||||
con_path = nm_connection_get_path (connection);
|
||||
con_uuid = nm_connection_get_uuid (connection);
|
||||
|
||||
config = nm_supplicant_config_new ();
|
||||
if (!config)
|
||||
return NULL;
|
||||
|
||||
security = nm_connection_get_setting_802_1x (connection);
|
||||
if (!nm_supplicant_config_add_setting_8021x (config, security, con_path, TRUE)) {
|
||||
if (!nm_supplicant_config_add_setting_8021x (config, security, con_uuid, TRUE)) {
|
||||
nm_log_warn (LOGD_DEVICE, "Couldn't add 802.1X security setting to supplicant config.");
|
||||
g_object_unref (config);
|
||||
config = NULL;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2005 - 2011 Red Hat, Inc.
|
||||
* Copyright (C) 2005 - 2012 Red Hat, Inc.
|
||||
* Copyright (C) 2006 - 2008 Novell, Inc.
|
||||
*/
|
||||
|
||||
|
|
@ -2391,14 +2391,14 @@ build_supplicant_config (NMDeviceWifi *self,
|
|||
s_wireless_sec = nm_connection_get_setting_wireless_security (connection);
|
||||
if (s_wireless_sec) {
|
||||
NMSetting8021x *s_8021x;
|
||||
const char *con_path = nm_connection_get_path (connection);
|
||||
const char *con_uuid = nm_connection_get_uuid (connection);
|
||||
|
||||
g_assert (con_path);
|
||||
g_assert (con_uuid);
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
if (!nm_supplicant_config_add_setting_wireless_security (config,
|
||||
s_wireless_sec,
|
||||
s_8021x,
|
||||
con_path)) {
|
||||
con_uuid)) {
|
||||
nm_log_err (LOGD_WIFI, "Couldn't add 802-11-wireless-security setting to "
|
||||
"supplicant config.");
|
||||
goto error;
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@ gboolean
|
|||
nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
||||
NMSettingWirelessSecurity *setting,
|
||||
NMSetting8021x *setting_8021x,
|
||||
const char *connection_uid)
|
||||
const char *con_uuid)
|
||||
{
|
||||
char *value;
|
||||
gboolean success;
|
||||
|
|
@ -593,7 +593,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
|||
|
||||
g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE);
|
||||
g_return_val_if_fail (setting != NULL, FALSE);
|
||||
g_return_val_if_fail (connection_uid != NULL, FALSE);
|
||||
g_return_val_if_fail (con_uuid != NULL, FALSE);
|
||||
|
||||
key_mgmt = nm_setting_wireless_security_get_key_mgmt (setting);
|
||||
if (!add_string_val (self, key_mgmt, "key_mgmt", TRUE, FALSE))
|
||||
|
|
@ -693,7 +693,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
|||
if (!strcmp (key_mgmt, "ieee8021x") || !strcmp (key_mgmt, "wpa-eap")) {
|
||||
if (!setting_8021x)
|
||||
return FALSE;
|
||||
if (!nm_supplicant_config_add_setting_8021x (self, setting_8021x, connection_uid, FALSE))
|
||||
if (!nm_supplicant_config_add_setting_8021x (self, setting_8021x, con_uuid, FALSE))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -712,7 +712,7 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
|||
gboolean
|
||||
nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
||||
NMSetting8021x *setting,
|
||||
const char *connection_uid,
|
||||
const char *con_uuid,
|
||||
gboolean wired)
|
||||
{
|
||||
char *tmp;
|
||||
|
|
@ -726,7 +726,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
|
||||
g_return_val_if_fail (NM_IS_SUPPLICANT_CONFIG (self), FALSE);
|
||||
g_return_val_if_fail (setting != NULL, FALSE);
|
||||
g_return_val_if_fail (connection_uid != NULL, FALSE);
|
||||
g_return_val_if_fail (con_uuid != NULL, FALSE);
|
||||
|
||||
value = nm_setting_802_1x_get_password (setting);
|
||||
if (value) {
|
||||
|
|
@ -851,7 +851,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
* If provisioning is allowed, use an blob format.
|
||||
*/
|
||||
if (fast_provisoning_allowed) {
|
||||
char *blob_name = g_strdup_printf ("blob://pac-blob-%s", connection_uid);
|
||||
char *blob_name = g_strdup_printf ("blob://pac-blob-%s", con_uuid);
|
||||
if (!add_string_val (self, blob_name, "pac_file", FALSE, FALSE)) {
|
||||
g_free (blob_name);
|
||||
return FALSE;
|
||||
|
|
@ -883,7 +883,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
switch (nm_setting_802_1x_get_ca_cert_scheme (setting)) {
|
||||
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
||||
array = nm_setting_802_1x_get_ca_cert_blob (setting);
|
||||
ADD_BLOB_VAL (array, "ca_cert", connection_uid);
|
||||
ADD_BLOB_VAL (array, "ca_cert", con_uuid);
|
||||
break;
|
||||
case NM_SETTING_802_1X_CK_SCHEME_PATH:
|
||||
path = nm_setting_802_1x_get_ca_cert_path (setting);
|
||||
|
|
@ -898,7 +898,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
switch (nm_setting_802_1x_get_phase2_ca_cert_scheme (setting)) {
|
||||
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
||||
array = nm_setting_802_1x_get_phase2_ca_cert_blob (setting);
|
||||
ADD_BLOB_VAL (array, "ca_cert2", connection_uid);
|
||||
ADD_BLOB_VAL (array, "ca_cert2", con_uuid);
|
||||
break;
|
||||
case NM_SETTING_802_1X_CK_SCHEME_PATH:
|
||||
path = nm_setting_802_1x_get_phase2_ca_cert_path (setting);
|
||||
|
|
@ -926,7 +926,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
switch (nm_setting_802_1x_get_private_key_scheme (setting)) {
|
||||
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
||||
array = nm_setting_802_1x_get_private_key_blob (setting);
|
||||
ADD_BLOB_VAL (array, "private_key", connection_uid);
|
||||
ADD_BLOB_VAL (array, "private_key", con_uuid);
|
||||
added = TRUE;
|
||||
break;
|
||||
case NM_SETTING_802_1X_CK_SCHEME_PATH:
|
||||
|
|
@ -964,7 +964,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
switch (nm_setting_802_1x_get_client_cert_scheme (setting)) {
|
||||
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
||||
array = nm_setting_802_1x_get_client_cert_blob (setting);
|
||||
ADD_BLOB_VAL (array, "client_cert", connection_uid);
|
||||
ADD_BLOB_VAL (array, "client_cert", con_uuid);
|
||||
break;
|
||||
case NM_SETTING_802_1X_CK_SCHEME_PATH:
|
||||
path = nm_setting_802_1x_get_client_cert_path (setting);
|
||||
|
|
@ -982,7 +982,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
switch (nm_setting_802_1x_get_phase2_private_key_scheme (setting)) {
|
||||
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
||||
array = nm_setting_802_1x_get_phase2_private_key_blob (setting);
|
||||
ADD_BLOB_VAL (array, "private_key2", connection_uid);
|
||||
ADD_BLOB_VAL (array, "private_key2", con_uuid);
|
||||
added = TRUE;
|
||||
break;
|
||||
case NM_SETTING_802_1X_CK_SCHEME_PATH:
|
||||
|
|
@ -1020,7 +1020,7 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
|||
switch (nm_setting_802_1x_get_phase2_client_cert_scheme (setting)) {
|
||||
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
||||
array = nm_setting_802_1x_get_phase2_client_cert_blob (setting);
|
||||
ADD_BLOB_VAL (array, "client_cert2", connection_uid);
|
||||
ADD_BLOB_VAL (array, "client_cert2", con_uuid);
|
||||
break;
|
||||
case NM_SETTING_802_1X_CK_SCHEME_PATH:
|
||||
path = nm_setting_802_1x_get_phase2_client_cert_path (setting);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright (C) 2006 - 2008 Red Hat, Inc.
|
||||
* Copyright (C) 2006 - 2012 Red Hat, Inc.
|
||||
* Copyright (C) 2007 - 2008 Novell, Inc.
|
||||
*/
|
||||
|
||||
|
|
@ -70,13 +70,13 @@ gboolean nm_supplicant_config_add_setting_wireless (NMSupplicantConfig *self,
|
|||
gboolean nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
|
||||
NMSettingWirelessSecurity *setting,
|
||||
NMSetting8021x *setting_8021x,
|
||||
const char *connection_uid);
|
||||
const char *con_uuid);
|
||||
|
||||
gboolean nm_supplicant_config_add_no_security (NMSupplicantConfig *self);
|
||||
|
||||
gboolean nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self,
|
||||
NMSetting8021x *setting,
|
||||
const char *connection_uid,
|
||||
const char *con_uuid,
|
||||
gboolean wired);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue