mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-15 00:55:17 +00:00
util: set system token for system identity
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
cbfebfc747
commit
b3fe905f53
@ -266,6 +266,7 @@ virIdentity *virIdentityGetSystem(void)
|
|||||||
#if WITH_SELINUX
|
#if WITH_SELINUX
|
||||||
char *con;
|
char *con;
|
||||||
#endif
|
#endif
|
||||||
|
g_autofree char *token = NULL;
|
||||||
|
|
||||||
if (!(ret = virIdentityNew()))
|
if (!(ret = virIdentityNew()))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -308,6 +309,12 @@ virIdentity *virIdentityGetSystem(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!(token = virIdentityEnsureSystemToken()))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (virIdentitySetSystemToken(ret, token) < 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return g_steal_pointer(&ret);
|
return g_steal_pointer(&ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user