You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt-viewer/SOURCES/0003-DOWNSTREAM-remote-view...

35 lines
1.3 KiB

From f06747e69cdade6c2774462a208535de890978c1 Mon Sep 17 00:00:00 2001
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
Date: Mon, 26 Aug 2019 10:18:20 -0300
Subject: [PATCH virt-viewer] [DOWNSTREAM] remote-viewer: Set admin privileges
when connecting to ovirt
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
index 2450096..9e63bfb 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -340,6 +340,7 @@ authenticate_cb(RestProxy *proxy, G_GNUC_UNUSED RestProxyAuth *auth,
g_object_set(G_OBJECT(proxy),
"username", username,
"password", password,
+ "admin", g_str_has_prefix(username, "admin"),
NULL);
} else {
rest_proxy_auth_cancel(auth);
@@ -433,6 +434,7 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
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",
--
2.26.2