|
|
b1b5c9 |
From ff8fb5975a6cf8d904256fa414b359c9f1c4682d Mon Sep 17 00:00:00 2001
|
|
|
b1b5c9 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
b1b5c9 |
Date: Tue, 23 Apr 2019 14:17:47 +0200
|
|
|
b1b5c9 |
Subject: [PATCH 1/6] cli: fix setting private key password
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
Fixes: fe390556abfe ('cli: add property type for 802-1x certificate properties (pt3)')
|
|
|
b1b5c9 |
(cherry picked from commit ee96387578ca5428b9836dda382f9e6d64d5a7a8)
|
|
|
b1b5c9 |
(cherry picked from commit d8badb280ce2acfcd0ae6fb3d8d133cae6326b7c)
|
|
|
b1b5c9 |
---
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-desc.c | 1 +
|
|
|
b1b5c9 |
1 file changed, 1 insertion(+)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
index 698ded869..b21ce37cf 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
@@ -2276,6 +2276,7 @@ _set_fcn_cert_8021x (ARGS_SET_FCN)
|
|
|
b1b5c9 |
password = path + strcspn (path, " \t");
|
|
|
b1b5c9 |
if (password[0] != '\0') {
|
|
|
b1b5c9 |
password[0] = '\0';
|
|
|
b1b5c9 |
+ password++;
|
|
|
b1b5c9 |
while (nm_utils_is_separator (password[0]))
|
|
|
b1b5c9 |
password++;
|
|
|
b1b5c9 |
} else {
|
|
|
b1b5c9 |
--
|
|
|
b1b5c9 |
2.20.1
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
From 2fe6e3a039fa1c1b1975020f409a1b505c27ec3d Mon Sep 17 00:00:00 2001
|
|
|
b1b5c9 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
b1b5c9 |
Date: Tue, 23 Apr 2019 14:55:32 +0200
|
|
|
b1b5c9 |
Subject: [PATCH 2/6] cli: parse escape sequences when reading an 802.1x
|
|
|
b1b5c9 |
private key
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
In this way it become possible to specify a filename that includes one
|
|
|
b1b5c9 |
of the delimiters.
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
(cherry picked from commit eac15501b2364a20505a90661e037a339a63b0ea)
|
|
|
b1b5c9 |
(cherry picked from commit 0f03773b75548151a98cae8d696fcfc698a23bb7)
|
|
|
b1b5c9 |
---
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-desc.c | 28 +++++++++++++++++----------
|
|
|
b1b5c9 |
1 file changed, 18 insertions(+), 10 deletions(-)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
index b21ce37cf..768e371e9 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
@@ -2268,17 +2268,25 @@ _set_fcn_cert_8021x (ARGS_SET_FCN)
|
|
|
b1b5c9 |
vtable = &nm_setting_8021x_scheme_vtable[property_info->property_typ_data->subtype.cert_8021x.scheme_type];
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
if (vtable->is_secret) {
|
|
|
b1b5c9 |
- gs_free char *path = NULL;
|
|
|
b1b5c9 |
nm_auto_free_secret char *password_free = NULL;
|
|
|
b1b5c9 |
- char *password;
|
|
|
b1b5c9 |
-
|
|
|
b1b5c9 |
- path = g_strdup (value);
|
|
|
b1b5c9 |
- password = path + strcspn (path, " \t");
|
|
|
b1b5c9 |
- if (password[0] != '\0') {
|
|
|
b1b5c9 |
- password[0] = '\0';
|
|
|
b1b5c9 |
- password++;
|
|
|
b1b5c9 |
- while (nm_utils_is_separator (password[0]))
|
|
|
b1b5c9 |
- password++;
|
|
|
b1b5c9 |
+ gs_free const char **strv = NULL;
|
|
|
b1b5c9 |
+ const char *password;
|
|
|
b1b5c9 |
+ const char *path;
|
|
|
b1b5c9 |
+ gsize len;
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
+ strv = nm_utils_escaped_tokens_split (value, NM_ASCII_SPACES);
|
|
|
b1b5c9 |
+ len = NM_PTRARRAY_LEN (strv);
|
|
|
b1b5c9 |
+ if (len > 2) {
|
|
|
b1b5c9 |
+ g_set_error_literal (error,
|
|
|
b1b5c9 |
+ NM_UTILS_ERROR,
|
|
|
b1b5c9 |
+ NM_UTILS_ERROR_INVALID_ARGUMENT,
|
|
|
b1b5c9 |
+ _("too many arguments. Please only specify a private key file and optionally a password"));
|
|
|
b1b5c9 |
+ return FALSE;
|
|
|
b1b5c9 |
+ }
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
+ path = len > 0 ? strv[0] : NULL;
|
|
|
b1b5c9 |
+ if (len == 2) {
|
|
|
b1b5c9 |
+ password = strv[1];
|
|
|
b1b5c9 |
} else {
|
|
|
b1b5c9 |
password_free = g_strdup (vtable->passwd_func (NM_SETTING_802_1X (setting)));
|
|
|
b1b5c9 |
password = password_free;
|
|
|
b1b5c9 |
--
|
|
|
b1b5c9 |
2.20.1
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
From 312f84cefd672ee141c999e374d49711176ff877 Mon Sep 17 00:00:00 2001
|
|
|
b1b5c9 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
b1b5c9 |
Date: Tue, 23 Apr 2019 21:14:31 +0200
|
|
|
b1b5c9 |
Subject: [PATCH 3/6] cli: remove bluetooth completion code
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
The 'bt-type' property alias accepts values provided by
|
|
|
b1b5c9 |
gen_func_bt_type(); instead the 'bluetooth.type' property can only be
|
|
|
b1b5c9 |
set to [dun, panu, nap] and therefore it doesn't need special
|
|
|
b1b5c9 |
handling.
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
(cherry picked from commit 78b9448b69d1e511aab9f24f4da8a6731c2dc7ee)
|
|
|
b1b5c9 |
(cherry picked from commit a9728a61125ef44ac5008ebb0d6d028d26d683af)
|
|
|
b1b5c9 |
---
|
|
|
b1b5c9 |
clients/cli/connections.c | 10 ++--------
|
|
|
b1b5c9 |
1 file changed, 2 insertions(+), 8 deletions(-)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
|
|
|
b1b5c9 |
index 6ee3b49f9..b8f9b5f27 100644
|
|
|
b1b5c9 |
--- a/clients/cli/connections.c
|
|
|
b1b5c9 |
+++ b/clients/cli/connections.c
|
|
|
b1b5c9 |
@@ -4561,14 +4561,8 @@ complete_property (const char *setting_name, const char *property, const char *p
|
|
|
b1b5c9 |
const NMMetaPropertyInfo *property_info;
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
property_info = nm_meta_property_info_find_by_name (setting_name, property);
|
|
|
b1b5c9 |
- if (property_info) {
|
|
|
b1b5c9 |
- if (complete_option ((const NMMetaAbstractInfo *) property_info, prefix, connection))
|
|
|
b1b5c9 |
- return;
|
|
|
b1b5c9 |
- }
|
|
|
b1b5c9 |
-
|
|
|
b1b5c9 |
- if ( strcmp (setting_name, NM_SETTING_BLUETOOTH_SETTING_NAME) == 0
|
|
|
b1b5c9 |
- && strcmp (property, NM_SETTING_BLUETOOTH_TYPE) == 0)
|
|
|
b1b5c9 |
- run_rl_generator (gen_func_bt_type, prefix);
|
|
|
b1b5c9 |
+ if (property_info)
|
|
|
b1b5c9 |
+ complete_option ((const NMMetaAbstractInfo *) property_info, prefix, connection);
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
/*****************************************************************************/
|
|
|
b1b5c9 |
--
|
|
|
b1b5c9 |
2.20.1
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
From 00cffb99f83e058835ed1f5a0ce78e4b2dc92e5c Mon Sep 17 00:00:00 2001
|
|
|
b1b5c9 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
b1b5c9 |
Date: Tue, 23 Apr 2019 21:35:19 +0200
|
|
|
b1b5c9 |
Subject: [PATCH 4/6] cli: allow completing filenames
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
Allow the completion function to indicate that the word should be
|
|
|
b1b5c9 |
completed as a filename by the shell.
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
(cherry picked from commit eb724293c25038c7e0f0d6789af2cea11da176eb)
|
|
|
b1b5c9 |
(cherry picked from commit 09f9831fc628c2bfa406987bc1e1b77c036a3b20)
|
|
|
b1b5c9 |
---
|
|
|
b1b5c9 |
clients/cli/connections.c | 23 ++++++++++++++++-------
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-access.c | 2 ++
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-access.h | 1 +
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-desc.c | 4 +++-
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-desc.h | 2 ++
|
|
|
b1b5c9 |
5 files changed, 24 insertions(+), 8 deletions(-)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
|
|
|
b1b5c9 |
index b8f9b5f27..034fc19f5 100644
|
|
|
b1b5c9 |
--- a/clients/cli/connections.c
|
|
|
b1b5c9 |
+++ b/clients/cli/connections.c
|
|
|
b1b5c9 |
@@ -3785,6 +3785,7 @@ _meta_abstract_complete (const NMMetaAbstractInfo *abstract_info, const char *te
|
|
|
b1b5c9 |
nmc_meta_environment_arg,
|
|
|
b1b5c9 |
&ctx,
|
|
|
b1b5c9 |
text,
|
|
|
b1b5c9 |
+ NULL,
|
|
|
b1b5c9 |
&values_to_free);
|
|
|
b1b5c9 |
if (values)
|
|
|
b1b5c9 |
return values_to_free ?: g_strdupv ((char **) values);
|
|
|
b1b5c9 |
@@ -4525,11 +4526,12 @@ run_rl_generator (rl_compentry_func_t *generator_func, const char *prefix)
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
static gboolean
|
|
|
b1b5c9 |
-complete_option (const NMMetaAbstractInfo *abstract_info, const char *prefix, NMConnection *context_connection)
|
|
|
b1b5c9 |
+complete_option (NmCli *nmc, const NMMetaAbstractInfo *abstract_info, const char *prefix, NMConnection *context_connection)
|
|
|
b1b5c9 |
{
|
|
|
b1b5c9 |
const OptionInfo *candidate;
|
|
|
b1b5c9 |
const char *const*values;
|
|
|
b1b5c9 |
gs_strfreev char **values_to_free = NULL;
|
|
|
b1b5c9 |
+ gboolean complete_filename = FALSE;
|
|
|
b1b5c9 |
const NMMetaOperationContext ctx = {
|
|
|
b1b5c9 |
.connection = context_connection,
|
|
|
b1b5c9 |
};
|
|
|
b1b5c9 |
@@ -4539,7 +4541,12 @@ complete_option (const NMMetaAbstractInfo *abstract_info, const char *prefix, NM
|
|
|
b1b5c9 |
nmc_meta_environment_arg,
|
|
|
b1b5c9 |
&ctx,
|
|
|
b1b5c9 |
prefix,
|
|
|
b1b5c9 |
+ &complete_filename,
|
|
|
b1b5c9 |
&values_to_free);
|
|
|
b1b5c9 |
+ if (complete_filename) {
|
|
|
b1b5c9 |
+ nmc->return_value = NMC_RESULT_COMPLETE_FILE;
|
|
|
b1b5c9 |
+ return TRUE;
|
|
|
b1b5c9 |
+ }
|
|
|
b1b5c9 |
if (values) {
|
|
|
b1b5c9 |
for (; values[0]; values++)
|
|
|
b1b5c9 |
g_print ("%s\n", values[0]);
|
|
|
b1b5c9 |
@@ -4556,13 +4563,13 @@ complete_option (const NMMetaAbstractInfo *abstract_info, const char *prefix, NM
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
static void
|
|
|
b1b5c9 |
-complete_property (const char *setting_name, const char *property, const char *prefix, NMConnection *connection)
|
|
|
b1b5c9 |
+complete_property (NmCli *nmc, const char *setting_name, const char *property, const char *prefix, NMConnection *connection)
|
|
|
b1b5c9 |
{
|
|
|
b1b5c9 |
const NMMetaPropertyInfo *property_info;
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
property_info = nm_meta_property_info_find_by_name (setting_name, property);
|
|
|
b1b5c9 |
if (property_info)
|
|
|
b1b5c9 |
- complete_option ((const NMMetaAbstractInfo *) property_info, prefix, connection);
|
|
|
b1b5c9 |
+ complete_option (nmc, (const NMMetaAbstractInfo *) property_info, prefix, connection);
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
/*****************************************************************************/
|
|
|
b1b5c9 |
@@ -4652,8 +4659,10 @@ nmc_read_connection_properties (NmCli *nmc,
|
|
|
b1b5c9 |
if (!get_value (&value, argc, argv, option, error))
|
|
|
b1b5c9 |
return FALSE;
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
- if (!*argc && nmc->complete)
|
|
|
b1b5c9 |
- complete_property (setting, strv[1], value ?: "", connection);
|
|
|
b1b5c9 |
+ if (!*argc && nmc->complete) {
|
|
|
b1b5c9 |
+ complete_property (nmc, setting, strv[1], value ?: "", connection);
|
|
|
b1b5c9 |
+ return TRUE;
|
|
|
b1b5c9 |
+ }
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
if (!set_property (nmc->client, connection, setting_name, strv[1], value, modifier, error))
|
|
|
b1b5c9 |
return FALSE;
|
|
|
b1b5c9 |
@@ -4734,7 +4743,7 @@ nmc_read_connection_properties (NmCli *nmc,
|
|
|
b1b5c9 |
return FALSE;
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
if (!*argc && nmc->complete)
|
|
|
b1b5c9 |
- complete_option (chosen, value ?: "", connection);
|
|
|
b1b5c9 |
+ complete_option (nmc, chosen, value ?: "", connection);
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
if (!set_option (nmc, connection, chosen, value, error))
|
|
|
b1b5c9 |
return FALSE;
|
|
|
b1b5c9 |
@@ -8861,7 +8870,7 @@ do_connection_import (NmCli *nmc, int argc, char **argv)
|
|
|
b1b5c9 |
if ( argc == 1
|
|
|
b1b5c9 |
&& nmc->complete) {
|
|
|
b1b5c9 |
nmc_complete_strings (*argv, "wireguard");
|
|
|
b1b5c9 |
- complete_option ((const NMMetaAbstractInfo *) nm_meta_property_info_vpn_service_type,
|
|
|
b1b5c9 |
+ complete_option (nmc, (const NMMetaAbstractInfo *) nm_meta_property_info_vpn_service_type,
|
|
|
b1b5c9 |
*argv,
|
|
|
b1b5c9 |
NULL);
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-access.c b/clients/common/nm-meta-setting-access.c
|
|
|
b1b5c9 |
index 8399f29db..ce5cd331c 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-access.c
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-access.c
|
|
|
b1b5c9 |
@@ -273,6 +273,7 @@ nm_meta_abstract_info_complete (const NMMetaAbstractInfo *abstract_info,
|
|
|
b1b5c9 |
gpointer environment_user_data,
|
|
|
b1b5c9 |
const NMMetaOperationContext *operation_context,
|
|
|
b1b5c9 |
const char *text,
|
|
|
b1b5c9 |
+ gboolean *out_complete_filename,
|
|
|
b1b5c9 |
char ***out_to_free)
|
|
|
b1b5c9 |
{
|
|
|
b1b5c9 |
const char *const*values;
|
|
|
b1b5c9 |
@@ -292,6 +293,7 @@ nm_meta_abstract_info_complete (const NMMetaAbstractInfo *abstract_info,
|
|
|
b1b5c9 |
environment_user_data,
|
|
|
b1b5c9 |
operation_context,
|
|
|
b1b5c9 |
text,
|
|
|
b1b5c9 |
+ out_complete_filename,
|
|
|
b1b5c9 |
out_to_free);
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
nm_assert (!*out_to_free || values == (const char *const*) *out_to_free);
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-access.h b/clients/common/nm-meta-setting-access.h
|
|
|
b1b5c9 |
index ec1c2ba00..38f22c7a4 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-access.h
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-access.h
|
|
|
b1b5c9 |
@@ -69,6 +69,7 @@ const char *const*nm_meta_abstract_info_complete (const NMMetaAbstractInfo *abst
|
|
|
b1b5c9 |
gpointer environment_user_data,
|
|
|
b1b5c9 |
const NMMetaOperationContext *operation_context,
|
|
|
b1b5c9 |
const char *text,
|
|
|
b1b5c9 |
+ gboolean *out_complete_filename,
|
|
|
b1b5c9 |
char ***out_to_free);
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
/*****************************************************************************/
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
index 768e371e9..7e4eb3d31 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
@@ -788,7 +788,7 @@ _env_warn_fcn (const NMMetaEnvironment *environment,
|
|
|
b1b5c9 |
const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, NMSetting *setting, const char *value, GError **error
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
#define ARGS_COMPLETE_FCN \
|
|
|
b1b5c9 |
- const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, const char *text, char ***out_to_free
|
|
|
b1b5c9 |
+ const NMMetaPropertyInfo *property_info, const NMMetaEnvironment *environment, gpointer environment_user_data, const NMMetaOperationContext *operation_context, const char *text, gboolean *out_complete_filename, char ***out_to_free
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
#define ARGS_VALUES_FCN \
|
|
|
b1b5c9 |
const NMMetaPropertyInfo *property_info, char ***out_to_free
|
|
|
b1b5c9 |
@@ -8159,6 +8159,7 @@ _meta_type_property_info_complete_fcn (const NMMetaAbstractInfo *abstract_info,
|
|
|
b1b5c9 |
gpointer environment_user_data,
|
|
|
b1b5c9 |
const NMMetaOperationContext *operation_context,
|
|
|
b1b5c9 |
const char *text,
|
|
|
b1b5c9 |
+ gboolean *out_complete_filename,
|
|
|
b1b5c9 |
char ***out_to_free)
|
|
|
b1b5c9 |
{
|
|
|
b1b5c9 |
const NMMetaPropertyInfo *info = (const NMMetaPropertyInfo *) abstract_info;
|
|
|
b1b5c9 |
@@ -8171,6 +8172,7 @@ _meta_type_property_info_complete_fcn (const NMMetaAbstractInfo *abstract_info,
|
|
|
b1b5c9 |
environment_user_data,
|
|
|
b1b5c9 |
operation_context,
|
|
|
b1b5c9 |
text,
|
|
|
b1b5c9 |
+ out_complete_filename,
|
|
|
b1b5c9 |
out_to_free);
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h
|
|
|
b1b5c9 |
index b69a07b50..2fee080b9 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-desc.h
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-desc.h
|
|
|
b1b5c9 |
@@ -221,6 +221,7 @@ struct _NMMetaPropertyType {
|
|
|
b1b5c9 |
gpointer environment_user_data,
|
|
|
b1b5c9 |
const NMMetaOperationContext *operation_context,
|
|
|
b1b5c9 |
const char *text,
|
|
|
b1b5c9 |
+ gboolean *out_complete_filename,
|
|
|
b1b5c9 |
char ***out_to_free);
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
/* Whether set_fcn() supports the '-' modifier. That is, whether the property
|
|
|
b1b5c9 |
@@ -444,6 +445,7 @@ struct _NMMetaType {
|
|
|
b1b5c9 |
gpointer environment_user_data,
|
|
|
b1b5c9 |
const NMMetaOperationContext *operation_context,
|
|
|
b1b5c9 |
const char *text,
|
|
|
b1b5c9 |
+ gboolean *out_complete_filename,
|
|
|
b1b5c9 |
char ***out_to_free);
|
|
|
b1b5c9 |
};
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
--
|
|
|
b1b5c9 |
2.20.1
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
From 4fe5505236fdf1d268d8d8a8cc9a339c4e2eb47e Mon Sep 17 00:00:00 2001
|
|
|
b1b5c9 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
b1b5c9 |
Date: Tue, 23 Apr 2019 22:01:15 +0200
|
|
|
b1b5c9 |
Subject: [PATCH 5/6] cli: complete 802.1x certificate file names
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
(cherry picked from commit ec4a12ecdbebbca5b8108e1611e95fa93b43d637)
|
|
|
b1b5c9 |
(cherry picked from commit 3d3fac55e38c5da544f8acc36aaf9334a92cbf11)
|
|
|
b1b5c9 |
---
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-desc.c | 21 +++++++++++++++++++++
|
|
|
b1b5c9 |
1 file changed, 21 insertions(+)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
index 7e4eb3d31..7c8f89563 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
@@ -2307,6 +2307,26 @@ _set_fcn_cert_8021x (ARGS_SET_FCN)
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
}
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
+static const char *const*
|
|
|
b1b5c9 |
+_complete_fcn_cert_8021x (ARGS_COMPLETE_FCN)
|
|
|
b1b5c9 |
+{
|
|
|
b1b5c9 |
+ const NMSetting8021xSchemeVtable *vtable;
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
+ vtable = &nm_setting_8021x_scheme_vtable[property_info->property_typ_data->subtype.cert_8021x.scheme_type];
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
+ if (vtable->is_secret) {
|
|
|
b1b5c9 |
+ gs_free const char **strv = NULL;
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
+ strv = nm_utils_escaped_tokens_split (text, NM_ASCII_SPACES);
|
|
|
b1b5c9 |
+ /* don't try to complete the password */
|
|
|
b1b5c9 |
+ if (NM_PTRARRAY_LEN (strv) > 1)
|
|
|
b1b5c9 |
+ return NULL;
|
|
|
b1b5c9 |
+ }
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
+ NM_SET_OUT (out_complete_filename, TRUE);
|
|
|
b1b5c9 |
+ return NULL;
|
|
|
b1b5c9 |
+}
|
|
|
b1b5c9 |
+
|
|
|
b1b5c9 |
static gconstpointer
|
|
|
b1b5c9 |
_get_fcn_gobject_bytes (ARGS_GET_FCN)
|
|
|
b1b5c9 |
{
|
|
|
b1b5c9 |
@@ -4466,6 +4486,7 @@ static const NMMetaPropertyType _pt_dcb = {
|
|
|
b1b5c9 |
static const NMMetaPropertyType _pt_cert_8021x = {
|
|
|
b1b5c9 |
.get_fcn = _get_fcn_cert_8021x,
|
|
|
b1b5c9 |
.set_fcn = _set_fcn_cert_8021x,
|
|
|
b1b5c9 |
+ .complete_fcn = _complete_fcn_cert_8021x,
|
|
|
b1b5c9 |
};
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
static const NMMetaPropertyType _pt_ethtool = {
|
|
|
b1b5c9 |
--
|
|
|
b1b5c9 |
2.20.1
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
From 1d02cd13072aa90471cdf0f0f2dde048a126c007 Mon Sep 17 00:00:00 2001
|
|
|
b1b5c9 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
b1b5c9 |
Date: Wed, 24 Apr 2019 15:21:34 +0200
|
|
|
b1b5c9 |
Subject: [PATCH 6/6] cli: hide certificate blobs unless --show-secrets is
|
|
|
b1b5c9 |
passed
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
This restores the behavior before commit 99711579ed43.
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
Fixes: 99711579ed43 ('cli: add property type for 802-1x certificate properties (pt2)').
|
|
|
b1b5c9 |
(cherry picked from commit c91aad49695fc0d5ff1dd07a4459dc7fbe9bdbc0)
|
|
|
b1b5c9 |
(cherry picked from commit 8c75120df055ac6c7b778a885473af202897abf9)
|
|
|
b1b5c9 |
---
|
|
|
b1b5c9 |
clients/common/nm-meta-setting-desc.c | 3 +--
|
|
|
b1b5c9 |
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
index 7c8f89563..9b5debcfe 100644
|
|
|
b1b5c9 |
--- a/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
+++ b/clients/common/nm-meta-setting-desc.c
|
|
|
b1b5c9 |
@@ -2229,8 +2229,7 @@ _get_fcn_cert_8021x (ARGS_GET_FCN)
|
|
|
b1b5c9 |
|
|
|
b1b5c9 |
switch (vtable->scheme_func (s_8021X)) {
|
|
|
b1b5c9 |
case NM_SETTING_802_1X_CK_SCHEME_BLOB:
|
|
|
b1b5c9 |
- if ( vtable->is_secret
|
|
|
b1b5c9 |
- && !NM_FLAGS_HAS (get_flags, NM_META_ACCESSOR_GET_FLAGS_SHOW_SECRETS))
|
|
|
b1b5c9 |
+ if (!NM_FLAGS_HAS (get_flags, NM_META_ACCESSOR_GET_FLAGS_SHOW_SECRETS))
|
|
|
b1b5c9 |
return _get_text_hidden (get_type);
|
|
|
b1b5c9 |
str = bytes_to_string (vtable->blob_func (s_8021X));
|
|
|
b1b5c9 |
break;
|
|
|
b1b5c9 |
--
|
|
|
b1b5c9 |
2.20.1
|
|
|
b1b5c9 |
|