Re: [PATCH 4/6] virshConnect: Don't leak polkit agent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 04, 2016 at 09:47:48 +0200, Michal Privoznik wrote:
> In our attempts to reconnect, we may create a polkit daemon.
> However, it may happen that we would rewrite the variable that
> already holds pointer to the agent.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  tools/virsh.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index d3fe06f..cb60edc 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -168,7 +168,7 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly)
>          err = virGetLastError();
>          if (err && err->domain == VIR_FROM_POLKIT &&
>              err->code == VIR_ERR_AUTH_UNAVAILABLE) {
> -            if (!(pkagent = virPolkitAgentCreate()))
> +            if (!pkagent && !(pkagent = virPolkitAgentCreate()))

This almost looks like a false positive, but I think that the loop of
conditions that would actually make us overwrite the agent is very
unintrospectable for humans too.

ACK

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]