Reviewed-by: Michal Privoznik <mpriv...@redhat.com>
Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
---
 src/util/viridentity.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/util/viridentity.c b/src/util/viridentity.c
index 5174f5a2d3..e822f0bd74 100644
--- a/src/util/viridentity.c
+++ b/src/util/viridentity.c
@@ -266,6 +266,7 @@ virIdentity *virIdentityGetSystem(void)
 #if WITH_SELINUX
     char *con;
 #endif
+    g_autofree char *token = NULL;
 
     if (!(ret = virIdentityNew()))
         return NULL;
@@ -308,6 +309,12 @@ virIdentity *virIdentityGetSystem(void)
     }
 #endif
 
+    if (!(token = virIdentityEnsureSystemToken()))
+        return NULL;
+
+    if (virIdentitySetSystemToken(ret, token) < 0)
+        return NULL;
+
     return g_steal_pointer(&ret);
 }
 
-- 
2.31.1

Reply via email to