summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-11 15:17:03 +0100
committerThomas Haller <thaller@redhat.com>2020-02-11 15:23:06 +0100
commitc69d70301703f8174746ccba44ff0f1f1777aada (patch)
tree5354e14edd0280f49f246c6c6ac80e6c673f1db0
parent2e53fd45613cbc45d86f63c9a207dc3cb869698a (diff)
all: use g_ascii_strcasecmp() instead of the locale dependent strcasecmp()
In all the cases, we don't want to perform locale dependent comparison. $ sed -i 's/\<strcasecmp\>/g_ascii_\0/g' $(git grep -w -l strcasecmp -- ':(exclude)shared/systemd/' )
-rw-r--r--clients/cli/connections.c32
-rw-r--r--clients/cli/devices.c36
-rw-r--r--clients/cli/general.c14
-rw-r--r--libnm-core/nm-setting-wireless-security.c12
-rw-r--r--src/devices/wifi/nm-wifi-factory.c4
-rw-r--r--src/initrd/nmi-cmdline-reader.c2
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c30
-rw-r--r--src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c2
8 files changed, 66 insertions, 66 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 6e4e7fd96..7c7e184ff 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -1349,9 +1349,9 @@ nmc_connection_profile_details (NMConnection *connection, NmCli *nmc)
const char *base_hdr = _("Connection profile details");
gboolean was_output = FALSE;
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = fields_common;
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
+ else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0)
fields_str = fields_all;
else
fields_str = nmc->required_fields;
@@ -1437,8 +1437,8 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
const char *base_hdr = _("Activate connection details");
gboolean was_output = FALSE;
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) {
- } else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) {
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+ } else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
@@ -1501,7 +1501,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
}
/* IP4 */
- if (strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[1]->name) == 0) {
+ if (g_ascii_strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[1]->name) == 0) {
gboolean b1 = FALSE;
NMIPConfig *cfg4 = nm_active_connection_get_ip4_config (acon);
@@ -1510,7 +1510,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
}
/* DHCP4 */
- if (strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[2]->name) == 0) {
+ if (g_ascii_strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[2]->name) == 0) {
gboolean b1 = FALSE;
NMDhcpConfig *dhcp4 = nm_active_connection_get_dhcp4_config (acon);
@@ -1519,7 +1519,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
}
/* IP6 */
- if (strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[3]->name) == 0) {
+ if (g_ascii_strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[3]->name) == 0) {
gboolean b1 = FALSE;
NMIPConfig *cfg6 = nm_active_connection_get_ip6_config (acon);
@@ -1528,7 +1528,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
}
/* DHCP6 */
- if (strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[4]->name) == 0) {
+ if (g_ascii_strcasecmp (nmc_fields_con_active_details_groups[group_idx]->name, nmc_fields_con_active_details_groups[4]->name) == 0) {
gboolean b1 = FALSE;
NMDhcpConfig *dhcp6 = nm_active_connection_get_dhcp6_config (acon);
@@ -1595,13 +1595,13 @@ split_required_fields_for_con_show (const char *input,
if (dot)
*dot = '\0';
- is_all = !dot && strcasecmp (s_mutable, "all") == 0;
- is_common = !dot && strcasecmp (s_mutable, "common") == 0;
+ is_all = !dot && g_ascii_strcasecmp (s_mutable, "all") == 0;
+ is_common = !dot && g_ascii_strcasecmp (s_mutable, "common") == 0;
found = FALSE;
for (i = 0; i < _NM_META_SETTING_TYPE_NUM; i++) {
if ( is_all || is_common
- || !strcasecmp (s_mutable, nm_meta_setting_infos[i].setting_name)) {
+ || !g_ascii_strcasecmp (s_mutable, nm_meta_setting_infos[i].setting_name)) {
if (dot)
*dot = '.';
g_string_append (str1, s_mutable);
@@ -1615,7 +1615,7 @@ split_required_fields_for_con_show (const char *input,
for (i = 0; nmc_fields_con_active_details_groups[i]; i++) {
if ( is_all || is_common
- || !strcasecmp (s_mutable, nmc_fields_con_active_details_groups[i]->name)) {
+ || !g_ascii_strcasecmp (s_mutable, nmc_fields_con_active_details_groups[i]->name)) {
if (dot)
*dot = '.';
g_string_append (str2, s_mutable);
@@ -1627,9 +1627,9 @@ split_required_fields_for_con_show (const char *input,
if (!found) {
if (dot)
*dot = '.';
- if (!strcasecmp (s_mutable, CON_SHOW_DETAIL_GROUP_PROFILE))
+ if (!g_ascii_strcasecmp (s_mutable, CON_SHOW_DETAIL_GROUP_PROFILE))
group_profile = TRUE;
- else if (!strcasecmp (s_mutable, CON_SHOW_DETAIL_GROUP_ACTIVE))
+ else if (!g_ascii_strcasecmp (s_mutable, CON_SHOW_DETAIL_GROUP_ACTIVE))
group_active = TRUE;
else {
gs_free char *allowed1 = nm_meta_abstract_infos_get_names_str ((const NMMetaAbstractInfo *const*) nm_meta_setting_infos_editor_p (), NULL);
@@ -2056,9 +2056,9 @@ do_connections_show (NmCli *nmc, int argc, char **argv)
if (nmc->complete)
goto finish;
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_CON_SHOW_COMMON;
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) {
+ else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index a23113339..964b7dce8 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -1430,9 +1430,9 @@ show_device_info (NMDevice *device, NmCli *nmc)
const char *base_hdr = _("Device details");
GPtrArray *fields_in_section = NULL;
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_DEV_SHOW_SECTIONS_COMMON;
- else if (strcasecmp (nmc->required_fields, "all") == 0) {
+ else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
@@ -1546,7 +1546,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
GPtrArray *aps;
/* section AP */
- if (!strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[4]->name)) {
+ if (!g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[4]->name)) {
NMC_OUTPUT_DATA_DEFINE_SCOPED (out);
if (state == NM_DEVICE_STATE_ACTIVATED) {
@@ -1604,42 +1604,42 @@ show_device_info (NMDevice *device, NmCli *nmc)
dhcp6 = nm_device_get_dhcp6_config (device);
/* IP4 */
- if (cfg4 && !strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[8]->name))
+ if (cfg4 && !g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[8]->name))
was_output = print_ip_config (cfg4, AF_INET, &nmc->nmc_config, section_fld);
/* DHCP4 */
- if (dhcp4 && !strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[9]->name))
+ if (dhcp4 && !g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[9]->name))
was_output = print_dhcp_config (dhcp4, AF_INET, &nmc->nmc_config, section_fld);
/* IP6 */
- if (cfg6 && !strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[10]->name))
+ if (cfg6 && !g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[10]->name))
was_output = print_ip_config (cfg6, AF_INET6, &nmc->nmc_config, section_fld);
/* DHCP6 */
- if (dhcp6 && !strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[11]->name))
+ if (dhcp6 && !g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[11]->name))
was_output = print_dhcp_config (dhcp6, AF_INET6, &nmc->nmc_config, section_fld);
/* Bond specific information */
if (NM_IS_DEVICE_BOND (device)) {
- if (!strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[12]->name))
+ if (!g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[12]->name))
was_output = print_bond_bridge_info (device, nmc, nmc_fields_dev_show_sections[12]->name, section_fld);
}
/* Team specific information */
if (NM_IS_DEVICE_TEAM (device)) {
- if (!strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[13]->name))
+ if (!g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[13]->name))
was_output = print_team_info (device, nmc, nmc_fields_dev_show_sections[13]->name, section_fld);
}
/* Bridge specific information */
if (NM_IS_DEVICE_BRIDGE (device)) {
- if (!strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[14]->name))
+ if (!g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[14]->name))
was_output = print_bond_bridge_info (device, nmc, nmc_fields_dev_show_sections[14]->name, section_fld);
}
/* VLAN-specific information */
if ((NM_IS_DEVICE_VLAN (device))) {
- if (!strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[15]->name)) {
+ if (!g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[15]->name)) {
char * vlan_id_str = g_strdup_printf ("%u", nm_device_vlan_get_vlan_id (NM_DEVICE_VLAN (device)));
NMDevice *parent = nm_device_vlan_get_parent (NM_DEVICE_VLAN (device));
NMC_OUTPUT_DATA_DEFINE_SCOPED (out);
@@ -1664,7 +1664,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
}
if (NM_IS_DEVICE_BT (device)) {
- if (!strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[16]->name)) {
+ if (!g_ascii_strcasecmp (nmc_fields_dev_show_sections[section_idx]->name, nmc_fields_dev_show_sections[16]->name)) {
NMC_OUTPUT_DATA_DEFINE_SCOPED (out);
tmpl = (const NMMetaAbstractInfo *const*) nmc_fields_dev_show_bluetooth;
@@ -1739,9 +1739,9 @@ do_devices_status (NmCli *nmc, int argc, char **argv)
return NMC_RESULT_ERROR_USER_INPUT;
}
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = "DEVICE,TYPE,STATE,CONNECTION";
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) {
+ else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
@@ -3060,9 +3060,9 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
}
}
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_DEV_WIFI_LIST_COMMON;
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) {
+ else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
@@ -4518,9 +4518,9 @@ do_device_lldp_list (NmCli *nmc, int argc, char **argv)
next_arg (nmc, &argc, &argv, NULL);
}
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = NMC_FIELDS_DEV_LLDP_LIST_COMMON;
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) {
+ else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
diff --git a/clients/cli/general.c b/clients/cli/general.c
index ccda0d52e..d806d0489 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -467,9 +467,9 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl
const char *fields_all = print_flds ?: NMC_FIELDS_NM_STATUS_ALL;
const char *fields_common = print_flds ?: NMC_FIELDS_NM_STATUS_COMMON;
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0)
fields_str = fields_common;
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
+ else if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "all") == 0)
fields_str = fields_all;
else
fields_str = nmc->required_fields;
@@ -544,8 +544,8 @@ print_permissions (void *user_data)
return;
}
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) {
- } else if (strcasecmp (nmc->required_fields, "all") == 0) {
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+ } else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
@@ -694,8 +694,8 @@ show_general_logging (NmCli *nmc)
.domains = &domains_cache,
};
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) {
- } else if (strcasecmp (nmc->required_fields, "all") == 0) {
+ if (!nmc->required_fields || g_ascii_strcasecmp (nmc->required_fields, "common") == 0) {
+ } else if (g_ascii_strcasecmp (nmc->required_fields, "all") == 0) {
} else
fields_str = nmc->required_fields;
@@ -874,7 +874,7 @@ nmc_switch_show (NmCli *nmc, const char *switch_name, const char *header)
g_return_val_if_fail (nmc != NULL, FALSE);
g_return_val_if_fail (switch_name != NULL, FALSE);
- if (nmc->required_fields && strcasecmp (nmc->required_fields, switch_name) != 0) {
+ if (nmc->required_fields && g_ascii_strcasecmp (nmc->required_fields, switch_name) != 0) {
g_string_printf (nmc->return_text, _("Error: '--fields' value '%s' is not valid here (allowed field: %s)"),
nmc->required_fields, switch_name);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c
index 1fedf93ad..036434cc3 100644
--- a/libnm-core/nm-setting-wireless-security.c
+++ b/libnm-core/nm-setting-wireless-security.c
@@ -166,7 +166,7 @@ nm_setting_wireless_security_add_proto (NMSettingWirelessSecurity *setting, cons
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->proto; iter; iter = g_slist_next (iter)) {
- if (strcasecmp (proto, (char *) iter->data) == 0)
+ if (g_ascii_strcasecmp (proto, (char *) iter->data) == 0)
return FALSE;
}
@@ -220,7 +220,7 @@ nm_setting_wireless_security_remove_proto_by_value (NMSettingWirelessSecurity *s
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->proto; iter; iter = g_slist_next (iter)) {
- if (strcasecmp (proto, (char *) iter->data) == 0) {
+ if (g_ascii_strcasecmp (proto, (char *) iter->data) == 0) {
priv->proto = g_slist_delete_link (priv->proto, iter);
_notify (setting, PROP_PROTO);
return TRUE;
@@ -310,7 +310,7 @@ nm_setting_wireless_security_add_pairwise (NMSettingWirelessSecurity *setting, c
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->pairwise; iter; iter = g_slist_next (iter)) {
- if (strcasecmp (pairwise, (char *) iter->data) == 0)
+ if (g_ascii_strcasecmp (pairwise, (char *) iter->data) == 0)
return FALSE;
}
@@ -366,7 +366,7 @@ nm_setting_wireless_security_remove_pairwise_by_value (NMSettingWirelessSecurity
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->pairwise; iter; iter = g_slist_next (iter)) {
- if (strcasecmp (pairwise, (char *) iter->data) == 0) {
+ if (g_ascii_strcasecmp (pairwise, (char *) iter->data) == 0) {
priv->pairwise = g_slist_delete_link (priv->pairwise, iter);
_notify (setting, PROP_PAIRWISE);
return TRUE;
@@ -457,7 +457,7 @@ nm_setting_wireless_security_add_group (NMSettingWirelessSecurity *setting, cons
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->group; iter; iter = g_slist_next (iter)) {
- if (strcasecmp (group, (char *) iter->data) == 0)
+ if (g_ascii_strcasecmp (group, (char *) iter->data) == 0)
return FALSE;
}
@@ -514,7 +514,7 @@ nm_setting_wireless_security_remove_group_by_value (NMSettingWirelessSecurity *s
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->group; iter; iter = g_slist_next (iter)) {
- if (strcasecmp (group, (char *) iter->data) == 0) {
+ if (g_ascii_strcasecmp (group, (char *) iter->data) == 0) {
priv->group = g_slist_delete_link (priv->group, iter);
_notify (setting, PROP_GROUP);
return TRUE;
diff --git a/src/devices/wifi/nm-wifi-factory.c b/src/devices/wifi/nm-wifi-factory.c
index 821460a54..9b87bbbf9 100644
--- a/src/devices/wifi/nm-wifi-factory.c
+++ b/src/devices/wifi/nm-wifi-factory.c
@@ -95,7 +95,7 @@ create_device (NMDeviceFactory *factory,
iface,
NM_PRINT_FMT_QUOTE_STRING (backend),
WITH_IWD ? " (iwd support enabled)" : "");
- if (!backend || !strcasecmp (backend, "wpa_supplicant")) {
+ if (!backend || !g_ascii_strcasecmp (backend, "wpa_supplicant")) {
NMDevice *device;
NMDeviceWifiCapabilities capabilities;
NM80211Mode mode;
@@ -129,7 +129,7 @@ create_device (NMDeviceFactory *factory,
return device;
}
#if WITH_IWD
- else if (!strcasecmp (backend, "iwd"))
+ else if (!g_ascii_strcasecmp (backend, "iwd"))
return nm_device_iwd_new (iface);
#endif
diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c
index ed2e5b226..bc870d65d 100644
--- a/src/initrd/nmi-cmdline-reader.c
+++ b/src/initrd/nmi-cmdline-reader.c
@@ -849,7 +849,7 @@ nmi_cmdline_reader_parse (const char *sysfs_dir, const char *const*argv)
neednet = _nm_utils_ascii_str_to_bool (argument, TRUE);
else if (strcmp (tag, "rd.znet") == 0)
parse_rd_znet (connections, argument, net_ifnames);
- else if (strcasecmp (tag, "BOOTIF") == 0) {
+ else if (g_ascii_strcasecmp (tag, "BOOTIF") == 0) {
nm_clear_g_free (&bootif_val);
bootif_val = g_strdup (argument);
}
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
index e2738f7ce..648ba21a4 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c
@@ -3829,7 +3829,7 @@ make_leap_setting (shvarFile *ifcfg,
nm_clear_g_free (&value);
value = svGetValueStr_cp (ifcfg, "SECURITYMODE");
- if (!value || strcasecmp (value, "leap"))
+ if (!value || g_ascii_strcasecmp (value, "leap"))
return NULL; /* Not LEAP */
nm_clear_g_free (&value);
@@ -5171,9 +5171,9 @@ handle_bridge_option (NMSetting *setting,
switch (param_spec->value_type) {
case G_TYPE_BOOLEAN:
if (m[i].extended_bool) {
- if (!strcasecmp (value, "on") || !strcasecmp (value, "yes") || !strcmp (value, "1"))
+ if (!g_ascii_strcasecmp (value, "on") || !g_ascii_strcasecmp (value, "yes") || !strcmp (value, "1"))
v = TRUE;
- else if (!strcasecmp (value, "off") || !strcasecmp (value, "no"))
+ else if (!g_ascii_strcasecmp (value, "off") || !g_ascii_strcasecmp (value, "no"))
v = FALSE;
else {
error_message = "is not a boolean";
@@ -5306,11 +5306,11 @@ make_bridge_setting (shvarFile *ifcfg,
value = svGetValueStr (ifcfg, "STP", &value_to_free);
if (value) {
- if (!strcasecmp (value, "on") || !strcasecmp (value, "yes")) {
+ if (!g_ascii_strcasecmp (value, "on") || !g_ascii_strcasecmp (value, "yes")) {
g_object_set (s_bridge, NM_SETTING_BRIDGE_STP, TRUE, NULL);
stp = TRUE;
stp_set = TRUE;
- } else if (!strcasecmp (value, "off") || !strcasecmp (value, "no")) {
+ } else if (!g_ascii_strcasecmp (value, "off") || !g_ascii_strcasecmp (value, "no")) {
g_object_set (s_bridge, NM_SETTING_BRIDGE_STP, FALSE, NULL);
stp_set = TRUE;
} else
@@ -5821,9 +5821,9 @@ connection_from_file_full (const char *filename,
devtype = svGetValueStr_cp (main_ifcfg, "DEVICETYPE");
if (devtype) {
- if (!strcasecmp (devtype, TYPE_TEAM))
+ if (!g_ascii_strcasecmp (devtype, TYPE_TEAM))
type = g_strdup (TYPE_TEAM);
- else if (!strcasecmp (devtype, TYPE_TEAM_PORT)) {
+ else if (!g_ascii_strcasecmp (devtype, TYPE_TEAM_PORT)) {
gs_free char *device = NULL;
type = svGetValueStr_cp (main_ifcfg, "TYPE");
@@ -5957,26 +5957,26 @@ connection_from_file_full (const char *filename,
}
if (svGetValueBoolean (main_ifcfg, "BONDING_MASTER", FALSE) &&
- strcasecmp (type, TYPE_BOND)) {
+ g_ascii_strcasecmp (type, TYPE_BOND)) {
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
"BONDING_MASTER=yes key only allowed in TYPE=bond connections");
return NULL;
}
/* Construct the connection */
- if (!strcasecmp (type, TYPE_ETHERNET))
+ if (!g_ascii_strcasecmp (type, TYPE_ETHERNET))
connection = wired_connection_from_ifcfg (filename, main_ifcfg, error);
- else if (!strcasecmp (type, TYPE_WIRELESS))
+ else if (!g_ascii_strcasecmp (type, TYPE_WIRELESS))
connection = wireless_connection_from_ifcfg (filename, main_ifcfg, error);
- else if (!strcasecmp (type, TYPE_INFINIBAND))
+ else if (!g_ascii_strcasecmp (type, TYPE_INFINIBAND))
connection = infiniband_connection_from_ifcfg (filename, main_ifcfg, error);
- else if (!strcasecmp (type, TYPE_BOND))
+ else if (!g_ascii_strcasecmp (type, TYPE_BOND))
connection = bond_connection_from_ifcfg (filename, main_ifcfg, error);
- else if (!strcasecmp (type, TYPE_TEAM))
+ else if (!g_ascii_strcasecmp (type, TYPE_TEAM))
connection = team_connection_from_ifcfg (filename, main_ifcfg, error);
- else if (!strcasecmp (type, TYPE_VLAN))
+ else if (!g_ascii_strcasecmp (type, TYPE_VLAN))
connection = vlan_connection_from_ifcfg (filename, main_ifcfg, error);
- else if (!strcasecmp (type, TYPE_BRIDGE))
+ else if (!g_ascii_strcasecmp (type, TYPE_BRIDGE))
connection = bridge_connection_from_ifcfg (filename, main_ifcfg, error);
else {
connection = create_unhandled_connection (filename, main_ifcfg, "unrecognized", out_unhandled);
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c
index 2bc32e052..2bf638d51 100644
--- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c
+++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-utils.c
@@ -72,7 +72,7 @@ check_suffix (const char *base, const char *tag)
len = strlen (base);
tag_len = strlen (tag);
- if ((len > tag_len) && !strcasecmp (base + len - tag_len, tag))
+ if ((len > tag_len) && !g_ascii_strcasecmp (base + len - tag_len, tag))
return TRUE;
return FALSE;
}