McdeSys: linux.c's network errors in the catalog, German measured (t0282)

The NetworkManager block of linux.c is messages 98-106 of mcdesys.cat now:
nmcli not there / not installed (the settings cannot be changed here), only
the administrator can join a Wi-Fi network, the network name cannot be used,
NetworkManager has no settings for a card, nmcli does not tell the settings
of a connection, NetworkManager did not take the settings or could not bring
a connection up again, there is no network card of that name.  German copy in
programs/localized/de_DE.UTF-8/msg/mcdesys.msg.

Measured with a runner (setlocale + the public calls):
LANG=C: "Only the administrator can join a Wi-Fi network." and
"NetworkManager has no settings for nosuchcard0."; LANG=de_DE.UTF-8: "Nur der
Administrator kann einem WLAN beitreten." and "NetworkManager hat keine
Einstellungen für nosuchcard0."
make mcde-linux MCDE_DIRS="install lib/McdeSys" and "install
programs/localized/C/msg" exit=0; "check lib/McdeSys": # FAIL: 0, exit=0;
MCDE_DIRS=plist: ok.
This commit is contained in:
lotherk committed 2026-11-16 11:38:54 +00:00
1 parent be48da24bb
commit d0f133e0f6
4 files changed
+38 -20

No files matched your search

+10 -20
View File
@@ -417,8 +417,7 @@ mcde_sys_wifi_scan(const char *ifname, McdeSysWifi *nets, size_t max)
int n = 0, i;
if (nm == NULL)
return mcde_sys_fail(MCDE_SYS_ENOTSUP, "NetworkManager (nmcli) "
"is not there.");
return mcde_sys_fail(MCDE_SYS_ENOTSUP, mcde_sys_msg(MSG_LX_NM_MISSING, "NetworkManager (nmcli) is not there."));
argv[0] = (char *) nm;
argv[1] = "-t";
argv[2] = "-f";
@@ -464,14 +463,11 @@ mcde_sys_wifi_join(const char *ifname, const char *ssid,
int n = 0;
if (geteuid() != 0)
return mcde_sys_fail(MCDE_SYS_EPERM, "Only the administrator "
"can join a Wi-Fi network.");
return mcde_sys_fail(MCDE_SYS_EPERM, mcde_sys_msg(MSG_LX_WIFI_EPERM, "Only the administrator can join a Wi-Fi network."));
if (nm == NULL)
return mcde_sys_fail(MCDE_SYS_ENOTSUP, "NetworkManager (nmcli) "
"is not there.");
return mcde_sys_fail(MCDE_SYS_ENOTSUP, mcde_sys_msg(MSG_LX_NM_MISSING, "NetworkManager (nmcli) is not there."));
if (ifname == NULL || !mcde_sys_wifi_ssid_arg_ok(ssid))
return mcde_sys_fail(MCDE_SYS_EINVAL, "The network name cannot "
"be used.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_LX_WIFI_BAD_SSID, "The network name cannot be used."));
argv[n++] = (char *) nm;
argv[n++] = "device";
argv[n++] = "wifi";
@@ -532,13 +528,11 @@ NmConnection(const char *ifname, char *name, size_t len)
"show", (char *) ifname, NULL };
if (nm == NULL)
return mcde_sys_fail(MCDE_SYS_ENOTSUP, "NetworkManager (nmcli) "
"is not installed: the settings cannot be changed here.");
return mcde_sys_fail(MCDE_SYS_ENOTSUP, mcde_sys_msg(MSG_LX_NM_NO_SETTINGS, "NetworkManager (nmcli) is not installed: the settings cannot be changed here."));
argv[0] = (char *) nm;
if (mcde_sys_capture(argv, out, sizeof out) != MCDE_SYS_OK ||
(line = NextLine(&p)) == NULL || line[0] == '\0')
return mcde_sys_fail(MCDE_SYS_ENOENT, "NetworkManager has no "
"settings for %s.", ifname);
return mcde_sys_fail(MCDE_SYS_ENOENT, mcde_sys_msg(MSG_LX_NM_NO_CONN, "NetworkManager has no settings for %s."), ifname);
NmUnescape(line);
snprintf(name, len, "%s", line);
return MCDE_SYS_OK;
@@ -612,8 +606,7 @@ mcde_sys_net_config_backend(const char *ifname, McdeSysNetConfig *c)
return r;
argv[0] = (char *) nm;
if (mcde_sys_capture(argv, out, sizeof out) != MCDE_SYS_OK)
return mcde_sys_fail(MCDE_SYS_EFAIL, "nmcli does not tell the "
"settings of \"%s\".", conn);
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_LX_NM_NO_DETAIL, "nmcli does not tell the settings of \"%s\"."), conn);
for (i = 0; i < 8; i++) {
if ((f[i] = NextLine(&p)) == NULL)
f[i] = "";
@@ -736,8 +729,7 @@ mcde_sys_net_configure_backend(const char *ifname, const McdeSysNetConfig *c)
argv[n++] = addr6;
argv[n] = NULL;
if (mcde_sys_run(argv) != MCDE_SYS_OK)
return mcde_sys_fail(MCDE_SYS_EFAIL, "NetworkManager did not "
"take the settings.");
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_LX_NM_SET_FAIL, "NetworkManager did not take the settings."));
return mcde_sys_net_renew(ifname);
}
@@ -752,14 +744,12 @@ mcde_sys_net_renew(const char *ifname)
int r;
if (!mcde_sys_net_ifname_ok(ifname))
return mcde_sys_fail(MCDE_SYS_EINVAL, "There is no network "
"card of that name.");
return mcde_sys_fail(MCDE_SYS_EINVAL, mcde_sys_msg(MSG_LX_NO_CARD, "There is no network card of that name."));
if ((r = NmConnection(ifname, conn, sizeof conn)) != MCDE_SYS_OK)
return r;
argv[0] = (char *) nm;
if (mcde_sys_run(argv) != MCDE_SYS_OK)
return mcde_sys_fail(MCDE_SYS_EFAIL, "NetworkManager could not "
"bring \"%s\" up again.", conn);
return mcde_sys_fail(MCDE_SYS_EFAIL, mcde_sys_msg(MSG_LX_NM_UP_FAIL, "NetworkManager could not bring \"%s\" up again."), conn);
return MCDE_SYS_OK;
}
+9
View File
@@ -100,3 +100,12 @@ $set 1
95 "%s" is not a name a computer can take.
96 No place for the state of the time service.
97 Cannot set the clock: %s.
98 NetworkManager (nmcli) is not there.
99 Only the administrator can join a Wi-Fi network.
100 The network name cannot be used.
101 NetworkManager (nmcli) is not installed: the settings cannot be changed here.
102 NetworkManager has no settings for %s.
103 nmcli does not tell the settings of "%s".
104 NetworkManager did not take the settings.
105 There is no network card of that name.
106 NetworkManager could not bring "%s" up again.
+10
View File
@@ -121,6 +121,16 @@ int mcde_sys_fail(int status, const char *fmt, ...);
#define MSG_BAD_HOSTNAME 95
#define MSG_NO_TIMESTATE 96
#define MSG_SETCLOCK_FAIL 97
/* linux.c: NetworkManager, the Wi-Fi join and the cards */
#define MSG_LX_NM_MISSING 98
#define MSG_LX_WIFI_EPERM 99
#define MSG_LX_WIFI_BAD_SSID 100
#define MSG_LX_NM_NO_SETTINGS 101
#define MSG_LX_NM_NO_CONN 102
#define MSG_LX_NM_NO_DETAIL 103
#define MSG_LX_NM_SET_FAIL 104
#define MSG_LX_NO_CARD 105
#define MSG_LX_NM_UP_FAIL 106
const char *mcde_sys_msg(int n, const char *text);
/* run ARGV (an absolute path first) and wait; MCDE_SYS_OK on exit status 0 */
@@ -98,3 +98,12 @@ $set 1
95 "%s" ist kein Name, den ein Rechner annehmen kann.
96 Kein Platz für den Zustand des Zeitdienstes.
97 Die Uhr kann nicht gestellt werden: %s.
98 NetworkManager (nmcli) ist nicht vorhanden.
99 Nur der Administrator kann einem WLAN beitreten.
100 Der Netzwerkname ist nicht verwendbar.
101 NetworkManager (nmcli) ist nicht installiert: die Einstellungen können hier nicht geändert werden.
102 NetworkManager hat keine Einstellungen für %s.
103 nmcli nennt die Einstellungen von "%s" nicht.
104 NetworkManager hat die Einstellungen nicht angenommen.
105 Es gibt keine Netzwerkkarte mit diesem Namen.
106 NetworkManager konnte "%s" nicht wieder hochfahren.