mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
src: stop checking virIdentityNew return value
This method will always succeed. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
821414f0cd
commit
1280a631ef
@ -2192,7 +2192,7 @@ remoteDispatchConnectSetIdentity(virNetServer *server G_GNUC_UNUSED,
|
||||
int nparams = 0;
|
||||
int rv = -1;
|
||||
virConnectPtr conn = remoteGetHypervisorConn(client);
|
||||
g_autoptr(virIdentity) ident = NULL;
|
||||
g_autoptr(virIdentity) ident = virIdentityNew();
|
||||
if (!conn)
|
||||
goto cleanup;
|
||||
|
||||
@ -2209,9 +2209,6 @@ remoteDispatchConnectSetIdentity(virNetServer *server G_GNUC_UNUSED,
|
||||
if (virConnectSetIdentityEnsureACL(conn) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(ident = virIdentityNew()))
|
||||
goto cleanup;
|
||||
|
||||
if (virIdentitySetParameters(ident, params, nparams) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -747,10 +747,7 @@ virNetServerClientCreateIdentity(virNetServerClient *client)
|
||||
g_autofree char *username = NULL;
|
||||
g_autofree char *groupname = NULL;
|
||||
g_autofree char *seccontext = NULL;
|
||||
g_autoptr(virIdentity) ret = NULL;
|
||||
|
||||
if (!(ret = virIdentityNew()))
|
||||
return NULL;
|
||||
g_autoptr(virIdentity) ret = virIdentityNew();
|
||||
|
||||
if (client->sock && virNetSocketIsLocal(client->sock)) {
|
||||
gid_t gid;
|
||||
|
@ -313,15 +313,12 @@ virIdentity *virIdentityGetSystem(void)
|
||||
g_autofree char *username = NULL;
|
||||
g_autofree char *groupname = NULL;
|
||||
unsigned long long startTime;
|
||||
g_autoptr(virIdentity) ret = NULL;
|
||||
g_autoptr(virIdentity) ret = virIdentityNew();
|
||||
#if WITH_SELINUX
|
||||
char *con;
|
||||
#endif
|
||||
g_autofree char *token = NULL;
|
||||
|
||||
if (!(ret = virIdentityNew()))
|
||||
return NULL;
|
||||
|
||||
if (virIdentitySetProcessID(ret, getpid()) < 0)
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user