Re: [PATCH] Return more error output if policykit auth fails.

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

 



On 01/27/2012 01:44 PM, Cole Robinson wrote:
> @@ -2537,15 +2538,20 @@ remoteDispatchAuthPolkit(virNetServerPtr server ATTRIBUTE_UNUSED,
>  error:
>      virCommandFree(cmd);
>      VIR_FREE(ident);
> -    VIR_FREE(pkout);
>      virResetLastError();
> +
>      if (authdismissed) {
>          virNetError(VIR_ERR_AUTH_CANCELLED, "%s",
>                      _("authentication cancelled by user"));
> +    } else if (pkout || pkerr) {
> +        virNetError(VIR_ERR_AUTH_FAILED, "%s %s", pkerr, pkout);

This could dereference NULL (well, it won't on glibc, but "(null) error"
or "out (null)" don't look any nicer).

Change it to:

    virNetError(VIR_ERR_AUTH_FAILED, "%s", pkerr ? pkerr : pkout);

and I'll call it good enough for ACK (that is, even if the app wrote to
both stdout and stderr, I think that printing just stderr output in that
case is probably reasonable).

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]