summary refs log tree commit diff
path: root/src/nmcli/utils.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2023-08-09 21:55:35 +0200
committerMichael Biebl <biebl@debian.org>2023-08-09 21:55:35 +0200
commit05e4a733f2141995181a551854d5df929f084adf (patch)
tree83bb937740a6667525ba0df046748ecaa829c269 /src/nmcli/utils.c
parent14b0f3a9dc9ea90d60a3b057350fd4d637dc021a (diff)
New upstream version 1.44.0 upstream/1.44.0
Diffstat (limited to 'src/nmcli/utils.c')
-rw-r--r--src/nmcli/utils.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/nmcli/utils.c b/src/nmcli/utils.c
index 2c155fff..29e84cc2 100644
--- a/src/nmcli/utils.c
+++ b/src/nmcli/utils.c
@@ -837,8 +837,8 @@ _output_selection_parse(const NMMetaAbstractInfo *const *fields,
  * @field_str: comma-separated field names to parse
  * @fields_array: array of allowed fields
  * @parse_groups: whether the fields can contain group prefix (e.g. general.driver)
- * @group_fields: (out) (allow-none): array of field names for particular groups
- * @error: (out) (allow-none): location to store error, or %NULL
+ * @group_fields: (out) (optional) (nullable): array of field names for particular groups
+ * @error: location to store error, or %NULL
  *
  * Parses comma separated fields in @fields_str according to @fields_array.
  * When @parse_groups is %TRUE, fields can be in the form 'group.field'. Then
@@ -1467,6 +1467,7 @@ nmc_terminal_spawn_pager(const NmcConfig *nmc_config)
     ev = g_get_environ();
     ev = g_environ_setenv(ev, "LESS", "FRSXMK", TRUE);
     ev = g_environ_setenv(ev, "LESSCHARSET", "utf-8", TRUE);
+    ev = g_environ_setenv(ev, "LESSSECURE", "1", FALSE);
 
     pager_pid = fork();
     if (pager_pid == -1) {
@@ -1821,3 +1822,19 @@ print_data(const NmcConfig     *nmc_config,
                               field_values);
     }
 }
+
+void
+nmc_warn_if_version_mismatch(NMClient *client)
+{
+    const char *nm_ver;
+
+    g_return_if_fail(client != NULL);
+
+    nm_ver = nm_client_get_version(client);
+    if (!nm_streq0(nm_ver, VERSION)) {
+        g_printerr(_("Warning: nmcli (%s) and NetworkManager (%s) versions don't match. "
+                     "Restarting NetworkManager is advised.\n"),
+                   VERSION,
+                   nm_ver ? nm_ver : _("Unknown"));
+    }
+}