From: Daniel P. Berrangé Date: Fri, 30 Apr 2021 15:21:59 +0000 (+0100) Subject: util: set system token for system identity X-Git-Tag: v7.4.0-rc1~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3fe905f53176ff00eef3317c0cba36a4ce67d77;p=thirdparty%2Flibvirt.git util: set system token for system identity Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- 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); }