[PATCH 6/7] util: Check for pkttyagent availability properly

Martin Kletzander mkletzan at redhat.com
Sat Dec 11 10:28:59 UTC 2021


On Sat, Dec 11, 2021 at 11:16:13AM +0100, Martin Kletzander wrote:
>On Fri, Dec 10, 2021 at 05:48:03PM -0700, Jim Fehlig wrote:
>>Hi Martin!
>>
>>I recently received a bug report (sorry, not public) about simple operations
>>like 'virsh list' hanging when invoked with an internal test tool. I found this
>>commit to be the culprit.
>>

OK, one more thing though, the fact that pkttyagent is spawned cannot
cause virsh to hang.  If the authentications is not required, then it
will just wait there for a while and then be killed.  If authentication
*is* required, then either you already have an agent running and that
one should be used since we're starting pkttyagent with `--fallback` or
you do not have any agent running in which case virsh list would fail
to connect.  Where does the virsh hang, what's the backtrace?

Anyway, if just adding:

     if (!isatty(STDIN_FILENO))
         return false;

to top of virPolkitAgentAvailable() solves your problem I do not have a
particular issue with it.  In any case I would like to better understand
the issue as just the fact that we're running pkttyagent should not
cause any issues.

Have a nice day,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211211/c9ccbb87/attachment-0001.sig>


More information about the libvir-list mailing list