summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-04-23 22:01:15 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-05-06 10:10:00 +0200
commitec4a12ecdbebbca5b8108e1611e95fa93b43d637 (patch)
treef8b9be0c3c04bb4ab9762044e7d3d3ae9a6849eb
parenteb724293c25038c7e0f0d6789af2cea11da176eb (diff)
downloadNetworkManager-ec4a12ecdbebbca5b8108e1611e95fa93b43d637.tar.gz
cli: complete 802.1x certificate file names
-rw-r--r--clients/common/nm-meta-setting-desc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index d70cf3c9a1..c7a7fe54bb 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -2294,6 +2294,26 @@ _set_fcn_cert_8021x (ARGS_SET_FCN)
}
}
+static const char *const*
+_complete_fcn_cert_8021x (ARGS_COMPLETE_FCN)
+{
+ const NMSetting8021xSchemeVtable *vtable;
+
+ vtable = &nm_setting_8021x_scheme_vtable[property_info->property_typ_data->subtype.cert_8021x.scheme_type];
+
+ if (vtable->is_secret) {
+ gs_free const char **strv = NULL;
+
+ strv = nm_utils_escaped_tokens_split (text, NM_ASCII_SPACES);
+ /* don't try to complete the password */
+ if (NM_PTRARRAY_LEN (strv) > 1)
+ return NULL;
+ }
+
+ NM_SET_OUT (out_complete_filename, TRUE);
+ return NULL;
+}
+
static gconstpointer
_get_fcn_bond_options (ARGS_GET_FCN)
{
@@ -4437,6 +4457,7 @@ static const NMMetaPropertyType _pt_dcb = {
static const NMMetaPropertyType _pt_cert_8021x = {
.get_fcn = _get_fcn_cert_8021x,
.set_fcn = _set_fcn_cert_8021x,
+ .complete_fcn = _complete_fcn_cert_8021x,
};
static const NMMetaPropertyType _pt_ethtool = {