summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-04-06 12:06:45 +0200
committerThomas Haller <thaller@redhat.com>2020-04-09 21:51:06 +0200
commit66274db2be06c7d77d5188b97869a5d8aae1c5c8 (patch)
tree1490f82b5a5cb2bbc077a8293f0171d147ed546f
parent9eacd99330876b72310e7fd1f4b4c1de13e58088 (diff)
downloadNetworkManager-66274db2be06c7d77d5188b97869a5d8aae1c5c8.tar.gz
cli/polkit: rename NM_POLKIT_LISTENER_SIGNAL_REQUEST signal to "request-sync"
The response is blocking, which generally is rather ugly. Let's not fix that now, but at least rename the signal so that it clearly points this out.
-rw-r--r--clients/cli/polkit-agent.c2
-rw-r--r--clients/common/nm-polkit-listener.c10
-rw-r--r--clients/common/nm-polkit-listener.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/clients/cli/polkit-agent.c b/clients/cli/polkit-agent.c
index 376a2f5d52..183562e751 100644
--- a/clients/cli/polkit-agent.c
+++ b/clients/cli/polkit-agent.c
@@ -66,7 +66,7 @@ nmc_polkit_agent_init (NmCli* nmc, gboolean for_session, GError **error)
}
g_signal_connect (listener,
- NM_POLKIT_LISTENER_SIGNAL_REQUEST,
+ NM_POLKIT_LISTENER_SIGNAL_REQUEST_SYNC,
G_CALLBACK (polkit_read_passwd),
nmc);
g_signal_connect (listener,
diff --git a/clients/common/nm-polkit-listener.c b/clients/common/nm-polkit-listener.c
index 01b0cb3688..ddab9f6a5c 100644
--- a/clients/common/nm-polkit-listener.c
+++ b/clients/common/nm-polkit-listener.c
@@ -51,7 +51,7 @@
enum {
REGISTERED,
- REQUEST,
+ REQUEST_SYNC,
ERROR,
LAST_SIGNAL
};
@@ -498,9 +498,9 @@ io_watch_have_data (int fd,
unescaped = g_strcompress (request->in_buffer->str);
if (NM_STR_HAS_PREFIX (unescaped, "PAM_PROMPT_ECHO")) {
- /* emit signal and wait for response */
+ /* FIXME(cli-async): emit signal and wait for response (blocking) */
g_signal_emit (request->listener,
- signals[REQUEST],
+ signals[REQUEST_SYNC],
0,
request->action_id,
request->message,
@@ -911,8 +911,8 @@ nm_polkit_listener_class_init (NMPolkitListenerClass *klass)
_PROPERTY_ENUMS_LAST,
obj_properties);
- signals[REQUEST] =
- g_signal_new (NM_POLKIT_LISTENER_SIGNAL_REQUEST,
+ signals[REQUEST_SYNC] =
+ g_signal_new (NM_POLKIT_LISTENER_SIGNAL_REQUEST_SYNC,
NM_TYPE_POLKIT_LISTENER,
G_SIGNAL_RUN_LAST,
0,
diff --git a/clients/common/nm-polkit-listener.h b/clients/common/nm-polkit-listener.h
index 8049a88fe9..c14d5932bc 100644
--- a/clients/common/nm-polkit-listener.h
+++ b/clients/common/nm-polkit-listener.h
@@ -7,7 +7,7 @@
#define __NM_POLKIT_LISTENER_H__
#define NM_POLKIT_LISTENER_SIGNAL_REGISTERED "registered"
-#define NM_POLKIT_LISTENER_SIGNAL_REQUEST "secret-request"
+#define NM_POLKIT_LISTENER_SIGNAL_REQUEST_SYNC "request-sync"
#define NM_POLKIT_LISTENER_SIGNAL_AUTH_SUCCESS "auth-success"
#define NM_POLKIT_LISTENER_SIGNAL_AUTH_FAILURE "auth-failure"
#define NM_POLKIT_LISTENER_SIGNAL_ERROR "error"