mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 00:40:19 +01:00
nmcli/agent: fix handling of polkit agent failure
On "nmcli agent all", when the polkit agent fails (while the NM agent succeeds), the failure is not communicated until the client exits.
This commit is contained in:
parent
fc4552d391
commit
7e8a84ae10
1 changed files with 7 additions and 1 deletions
|
|
@ -201,10 +201,16 @@ do_agent_all (NmCli *nmc, int argc, char **argv)
|
|||
|
||||
/* Run both secret and polkit agent */
|
||||
secret_res = do_agent_secret (nmc, argc, argv);
|
||||
if (secret_res != NMC_RESULT_SUCCESS)
|
||||
if (secret_res != NMC_RESULT_SUCCESS) {
|
||||
g_printerr ("%s\n", nmc->return_text->str);
|
||||
g_string_truncate (nmc->return_text, 0);
|
||||
}
|
||||
|
||||
nmc->return_value = do_agent_polkit (nmc, argc, argv);
|
||||
if (nmc->return_value != NMC_RESULT_SUCCESS) {
|
||||
g_printerr ("%s\n", nmc->return_text->str);
|
||||
g_string_truncate (nmc->return_text, 0);
|
||||
}
|
||||
|
||||
if (nmc->return_value == NMC_RESULT_SUCCESS && secret_res != NMC_RESULT_SUCCESS)
|
||||
nmc->return_value = secret_res;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue