From 9f6ecbae695caef987490b74d2f3bafc289082dd Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Fri, 2 Aug 2024 13:30:20 +0200 Subject: [PATCH] keyfile: do not write offensive terms into keyfile As part of the conscious language efforts we are not writing offensive terms into keyfiles anymore. This won't break users upgrading as we still read such values if they are present into the keyfile. For existing profiles, NetworkManager will remove the offensive terms when editing the keyfile. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2009 --- NEWS | 1 + src/libnm-core-impl/nm-keyfile.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 54a1fabfe3..720370ee57 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,7 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE! * Allow specifying a system OVS interface by MAC address * ndisc: Support multiple gateways for a single network * wifi: Support configuring channel-width in AP mode +* keyfile: Stop writing offensive terms into keyfiles ============================================= NetworkManager-1.48 diff --git a/src/libnm-core-impl/nm-keyfile.c b/src/libnm-core-impl/nm-keyfile.c index 078ea5d766..81f7170ea5 100644 --- a/src/libnm-core-impl/nm-keyfile.c +++ b/src/libnm-core-impl/nm-keyfile.c @@ -4074,6 +4074,16 @@ write_setting_value(KeyfileWriterInfo *info, return; } + /* Don't write offensive terms that are already deprecated as the new inclusive terms + * are being written. + */ + if (NM_IN_STRSET(key, + NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, + NM_SETTING_CONNECTION_MASTER, + NM_SETTING_CONNECTION_SLAVE_TYPE, + NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST)) + return; + value = (GValue){0}; g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(property_info->param_spec));