virt-viewer/SOURCES/0003-DOWNSTREAM-remote-view...

35 lines
1.3 KiB
Diff
Raw Normal View History

2020-11-03 12:09:39 +00:00
From f06747e69cdade6c2774462a208535de890978c1 Mon Sep 17 00:00:00 2001
2019-11-05 20:18:29 +00:00
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Mon, 26 Aug 2019 10:18:20 -0300
2020-11-03 12:09:39 +00:00
Subject: [PATCH virt-viewer] [DOWNSTREAM] remote-viewer: Set admin privileges
when connecting to ovirt
2019-11-05 20:18:29 +00:00
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
---
src/remote-viewer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
2020-11-03 12:09:39 +00:00
index 2450096..9e63bfb 100644
2019-11-05 20:18:29 +00:00
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
2020-11-03 12:09:39 +00:00
@@ -340,6 +340,7 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
2019-11-05 20:18:29 +00:00
g_object_set(G_OBJECT(proxy),
"username", username,
"password", password,
+ "admin", g_str_has_prefix(username, "admin"),
NULL);
} else {
2020-11-03 12:09:39 +00:00
rest_proxy_auth_cancel(auth);
@@ -433,6 +434,7 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
2019-11-05 20:18:29 +00:00
proxy = ovirt_proxy_new(rest_uri);
g_object_set(proxy,
"username", username,
+ "admin", g_str_has_prefix(username, "admin"),
NULL);
ovirt_set_proxy_options(proxy);
g_signal_connect(G_OBJECT(proxy), "authenticate",
--
2020-11-03 12:09:39 +00:00
2.26.2
2019-11-05 20:18:29 +00:00