mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-19 12:28:29 +02:00
ifcfg-rh: read/write zone name from/to ZONE key
This commit is contained in:
parent
04c8ec7360
commit
3e11682ddc
2 changed files with 13 additions and 1 deletions
|
|
@ -85,7 +85,7 @@ make_connection_setting (const char *file,
|
|||
{
|
||||
NMSettingConnection *s_con;
|
||||
const char *ifcfg_name = NULL;
|
||||
char *new_id = NULL, *uuid = NULL, *value;
|
||||
char *new_id = NULL, *uuid = NULL, *zone = NULL, *value;
|
||||
char *ifcfg_id;
|
||||
|
||||
ifcfg_name = utils_get_ifcfg_name (file, TRUE);
|
||||
|
|
@ -127,6 +127,7 @@ make_connection_setting (const char *file,
|
|||
g_free (uuid);
|
||||
uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName);
|
||||
}
|
||||
|
||||
g_object_set (s_con,
|
||||
NM_SETTING_CONNECTION_TYPE, type,
|
||||
NM_SETTING_CONNECTION_UUID, uuid,
|
||||
|
|
@ -153,6 +154,15 @@ make_connection_setting (const char *file,
|
|||
g_strfreev (items);
|
||||
}
|
||||
|
||||
|
||||
zone = svGetValue(ifcfg, "ZONE", FALSE);
|
||||
if (!zone || !strlen (zone)) {
|
||||
g_free (zone);
|
||||
zone = NULL;
|
||||
}
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_ZONE, zone, NULL);
|
||||
g_free (zone);
|
||||
|
||||
return NM_SETTING (s_con);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1097,6 +1097,8 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
|
|||
svSetValue (ifcfg, "USERS", str->str, FALSE);
|
||||
g_string_free (str, TRUE);
|
||||
}
|
||||
|
||||
svSetValue (ifcfg, "ZONE", nm_setting_connection_get_zone(s_con), FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue