From afd281102879168f13fb4d1deff9535542ad6fc5 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 22 Dec 2016 16:19:54 +0100 Subject: [PATCH] cli: do not require a password when setting a PK It results in a rather confusing behavior: # nmcli c modify wifi \ 802-1x.private-key /etc/pki/themostsecret.key \ 802-1x.private-key-password verystrong Error: failed to modify 802-1x.private-key: private key password not provided. Moreover, the user might have a good reason for not specifying it on a command liue and it's not strictly required anyway -- we'll do fine if we don't verify a private key at addition time. --- clients/cli/settings.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 3b1f0ecb9c..08d2e99c5d 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -3643,19 +3643,12 @@ DEFINE_ALLOWED_VAL_FUNC (nmc_property_connection_allowed_lldp, lldp_valid_values password = strv[1]; \ else \ password = pwd_func (NM_SETTING_802_1X (setting)); \ - if (password) { \ - char *tmp_pwd = g_strdup (password); \ - success = set_func (NM_SETTING_802_1X (setting), \ - path, \ - tmp_pwd, \ - NM_SETTING_802_1X_CK_SCHEME_PATH, \ - NULL, \ - error); \ - g_free (tmp_pwd); \ - } else { \ - success = FALSE; \ - g_set_error_literal (error, 1, 0, _("private key password not provided")); \ - } \ + success = set_func (NM_SETTING_802_1X (setting), \ + path, \ + password, \ + NM_SETTING_802_1X_CK_SCHEME_PATH, \ + NULL, \ + error); \ g_free (val_strip); \ g_strfreev (strv); \ return success; \