summaryrefslogtreecommitdiff
path: root/clients/cli/nmcli.c
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2014-10-30 15:45:43 +0100
committerJiří Klimeš <jklimes@redhat.com>2014-11-07 11:21:35 +0100
commit0d9c9208026a8c5c14b657bceb477931fd35375d (patch)
tree084650b6126059806a8a4c76bc2b8ee94cbf2f17 /clients/cli/nmcli.c
parent9e6e6344cb114c5d79eae52594547112d6f800e9 (diff)
downloadNetworkManager-0d9c9208026a8c5c14b657bceb477931fd35375d.tar.gz
cli: add 'nmcli agent' commandjk/nmcli-agent-command
Synopsis: nmcli agent { secret | polkit | all } The command runs separate NetworkManager secret agent or session polkit agent, or both. It is useful when - no other secret agent is available (such as GUI nm-applet, gnome-shell, KDE applet) - no other polkit agent is available (such as polkit-gnome-authentication-agent-1, polkit-kde-authentication-agent-1 or lxpolkit)
Diffstat (limited to 'clients/cli/nmcli.c')
-rw-r--r--clients/cli/nmcli.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c
index 76033417ee..ade0a6bd4d 100644
--- a/clients/cli/nmcli.c
+++ b/clients/cli/nmcli.c
@@ -43,6 +43,7 @@
#include "connections.h"
#include "devices.h"
#include "general.h"
+#include "agent.h"
#if defined(NM_DIST_VERSION)
# define NMCLI_VERSION NM_DIST_VERSION
@@ -102,6 +103,7 @@ usage (const char *prog_name)
" r[adio] NetworkManager radio switches\n"
" c[onnection] NetworkManager's connections\n"
" d[evice] devices managed by NetworkManager\n"
+ " a[gent] NetworkManager secret agent or polkit agent\n"
"\n"),
prog_name);
}
@@ -122,6 +124,7 @@ static const struct cmd {
{ "radio", do_radio },
{ "connection", do_connections },
{ "device", do_devices },
+ { "agent", do_agent },
{ "help", do_help },
{ 0 }
};
@@ -266,14 +269,6 @@ parse_command_line (NmCli *nmc, int argc, char **argv)
}
if (argc > 1) {
- GError *error = NULL;
-
- /* Initialize polkit agent */
- if (!nmc_polkit_agent_init (&nm_cli, FALSE, &error)) {
- g_printerr ("Polkit agent initialization failed: %s\n", error->message);
- g_error_free (error);
- }
-
/* Now run the requested command */
return do_cmd (nmc, argv[1], argc-1, argv+1);
}