diff --git a/clients/cli/common.c b/clients/cli/common.c index 3656cdbf82..a85d47687b 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -840,7 +840,7 @@ nmc_secrets_requested (NMSecretAgentSimple *agent, } success = get_secrets_from_user (request_id, title, msg, connection, nmc->nmc_config.in_editor || nmc->ask, - nmc->show_secrets, nmc->pwds_hash, secrets); + nmc->nmc_config.show_secrets, nmc->pwds_hash, secrets); if (success) nm_secret_agent_simple_response (agent, request_id, secrets); else { diff --git a/clients/cli/connections.c b/clients/cli/connections.c index d9ed01c719..5199fbcf89 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -1873,9 +1873,9 @@ do_connections_show (NmCli *nmc, int argc, char **argv) if (without_fields || profile_flds) { if (con) { nmc->required_fields = profile_flds; - if (nmc->show_secrets) + if (nmc->nmc_config.show_secrets) update_secrets_in_connection (NM_REMOTE_CONNECTION (con), con); - res = nmc_connection_profile_details (con, nmc, nmc->show_secrets); + res = nmc_connection_profile_details (con, nmc, nmc->nmc_config.show_secrets); nmc->required_fields = NULL; if (!res) goto finish; diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 64a75a07d1..aa0ff083f4 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -3110,7 +3110,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) if (ap_flags & NM_802_11_AP_FLAGS_PRIVACY) { /* Ask for missing password when one is expected and '--ask' is used */ if (!password && nmc->ask) - password = passwd_ask = nmc_readline_echo (nmc->show_secrets, _("Password: ")); + password = passwd_ask = nmc_readline_echo (nmc->nmc_config.show_secrets, _("Password: ")); if (password) { if (!connection) @@ -3408,7 +3408,7 @@ do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv) next_arg (nmc, &argc, &argv, NULL); } - show_password = nmc->show_secrets || show_password; + show_password = nmc->nmc_config.show_secrets || show_password; if (nmc->complete) return nmc->return_value; diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index dcb86fe1dc..a341940e32 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -538,7 +538,7 @@ nmc_init (NmCli *nmc) nmc->required_fields = NULL; nmc->ask = FALSE; nmc->complete = FALSE; - nmc->show_secrets = FALSE; + nmc->nmc_config_mutable.show_secrets = FALSE; nmc->nmc_config_mutable.use_colors = NMC_USE_COLOR_AUTO; nmc->nmc_config_mutable.in_editor = FALSE; nmc->editor_status_line = FALSE; diff --git a/clients/cli/nmcli.h b/clients/cli/nmcli.h index c3949b5f68..1beaf74353 100644 --- a/clients/cli/nmcli.h +++ b/clients/cli/nmcli.h @@ -111,9 +111,10 @@ typedef enum { typedef struct _NmcConfig { NMCPrintOutput print_output; /* Output mode */ NmcColorOption use_colors; /* Whether to use colors for output: option '--color' */ - gboolean multiline_output; /* Multiline output instead of default tabular */ - gboolean escape_values; /* Whether to escape ':' and '\' in terse tabular mode */ - gboolean in_editor; /* Whether running the editor - nmcli con edit' */ + bool multiline_output; /* Multiline output instead of default tabular */ + bool escape_values; /* Whether to escape ':' and '\' in terse tabular mode */ + bool in_editor; /* Whether running the editor - nmcli con edit' */ + bool show_secrets; /* Whether to display secrets (both input and output): option '--show-secrets' */ } NmcConfig; typedef struct _NmcOutputData { @@ -143,7 +144,6 @@ typedef struct _NmCli { char *required_fields; /* Required fields in output: '--fields' option */ gboolean ask; /* Ask for missing parameters: option '--ask' */ gboolean complete; /* Autocomplete the command line */ - gboolean show_secrets; /* Whether to display secrets (both input and output): option '--show-secrets' */ gboolean editor_status_line; /* Whether to display status line in connection editor */ gboolean editor_save_confirmation; /* Whether to ask for confirmation on saving connections with 'autoconnect=yes' */ gboolean editor_show_secrets; /* Whether to display secrets in the editor' */ diff --git a/clients/cli/utils.c b/clients/cli/utils.c index ddefb4c2a3..4368267dc6 100644 --- a/clients/cli/utils.c +++ b/clients/cli/utils.c @@ -152,7 +152,7 @@ parse_global_arg (NmCli *nmc, const char *arg) if (nmc_arg_is_option (arg, "ask")) nmc->ask = TRUE; else if (nmc_arg_is_option (arg, "show-secrets")) - nmc->show_secrets = TRUE; + nmc->nmc_config_mutable.show_secrets = TRUE; else return FALSE;