diff options
Diffstat (limited to 'clients')
| -rw-r--r-- | clients/cli/connections.c | 10 | ||||
| -rw-r--r-- | clients/cli/nmcli-completion | 7 | ||||
| -rw-r--r-- | clients/cli/nmcli.c | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index dfd619cc..36c41ace 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -2179,6 +2179,10 @@ active_connection_state_cb (NMActiveConnection *active, GParamSpec *pspec, Activ g_print (_("Connection successfully activated (D-Bus active path: %s)\n"), nm_object_get_path (NM_OBJECT (active))); activate_connection_info_finish (info); + } else if (state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) { + g_string_printf (nmc->return_text, _("Error: Connection activation failed.")); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + activate_connection_info_finish (info); } else if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING) { /* activating master connection does not automatically activate any slaves, so their * active connection state will not progress beyond ACTIVATING state. @@ -4149,7 +4153,8 @@ set_ip4_address (NmCli *nmc, NMConnection *con, OptionInfo *option, const char * NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL); } - return set_property (con, option->setting_name, option->property, value, '\0', error); + return set_property (con, option->setting_name, option->property, value, + option->flags & OPTION_MULTI ? '+' : '\0', error); } static gboolean @@ -4168,7 +4173,8 @@ set_ip6_address (NmCli *nmc, NMConnection *con, OptionInfo *option, const char * NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL, NULL); } - return set_property (con, option->setting_name, option->property, value, '\0', error); + return set_property (con, option->setting_name, option->property, value, + option->flags & OPTION_MULTI ? '+' : '\0', error); } diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion index e78ab85c..e1716f60 100644 --- a/clients/cli/nmcli-completion +++ b/clients/cli/nmcli-completion @@ -25,10 +25,11 @@ _nmcli_list_nl() # [']bla'bla"bla\bla bla --> [']bla'\''bla"bla\bla bla COMPREPLY[$i]="${entry//\'/${escaped_single_quote}}" elif [[ "${cur:0:1}" == '"' ]]; then - # started with double quote, escaping all double quotes and all backslashes + # started with double quote, escaping all double quotes, backslashes and ! # ["]bla'bla"bla\bla bla --> ["]bla'bla\"bla\\bla bla entry="${entry//\\/\\\\}" entry="${entry//\"/\\\"}" + entry="${entry//!/\"\\!\"}" COMPREPLY[$i]="$entry" else # no quotes in front, escaping _everything_ @@ -37,6 +38,10 @@ _nmcli_list_nl() entry="${entry//\'/\'}" entry="${entry//\"/\\\"}" entry="${entry// /\\ }" + entry="${entry//\(/\\(}" + entry="${entry//)/\\)}" + entry="${entry//!/\\!}" + entry="${entry//&/\\&}" COMPREPLY[$i]="$entry" fi (( i++ )) diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 8bc8828b..62088087 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -595,7 +595,7 @@ nmc_get_client (NmCli *nmc) if (!nmc->client) { nmc->client = nm_client_new (NULL, &error); if (!nmc->client) { - g_critical (_("Error: Could not create NMClient object: %s."), error->message); + g_printerr ("%s\n", error->message); g_clear_error (&error); exit (NMC_RESULT_ERROR_UNKNOWN); } |