diff --git a/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch b/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch new file mode 100644 index 0000000..49a3845 --- /dev/null +++ b/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch @@ -0,0 +1,34 @@ +From 306f15c98fb5626f35f876b1f3fa39dee37e5810 Mon Sep 17 00:00:00 2001 +From: Martin Kletzander +Date: Sat, 11 Dec 2021 14:23:11 +0100 +Subject: [PATCH] util: Don't spawn pkttyagent when stdin is not a tty + +My idea was that running pkttyagent unconditionally, modulo checks that +pkttyagent itself does to make sure it does not fail, is not going to be an +issue turned out to be wrong. Adding back the original check for stdin being a +tty helps in some testing scenarios as reported by Jim Fehlig and does not +really cause any issues. I originally wanted it in because it also made +pkttyagent auth work with redirected input into virsh (with a connection that +requires polkit authentication and without a session-wide polkit tty agent, +basically making pkttyagent necessary to succeed). But anyone running virsh +like that is asking for problems already anyway =) + +Signed-off-by: Martin Kletzander +--- + src/util/virpolkit.c | 3 +++ + 1 file changed, 3 insertions(+) + +Index: libvirt-7.10.0/src/util/virpolkit.c +=================================================================== +--- libvirt-7.10.0.orig/src/util/virpolkit.c ++++ libvirt-7.10.0/src/util/virpolkit.c +@@ -237,6 +237,9 @@ virPolkitAgentAvailable(void) + const char *termid = ctermid(NULL); + VIR_AUTOCLOSE fd = -1; + ++ if (!isatty(STDIN_FILENO)) ++ return false; ++ + if (!virFileIsExecutable(PKTTYAGENT)) + return false; + diff --git a/libvirt.changes b/libvirt.changes index 2f6b35a..5ee3448 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Dec 13 15:15:35 UTC 2021 - James Fehlig + +- Don't spawn pkttyagent when stdin is not a tty + 0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch + bsc#1193574 + ------------------------------------------------------------------- Thu Dec 2 22:36:06 UTC 2021 - James Fehlig diff --git a/libvirt.spec b/libvirt.spec index 11e24fe..a762bc5 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -295,6 +295,7 @@ Patch5: a7a03324-libxl-protect-logger-access.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch +Patch102: 0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch # Need to go upstream Patch150: libvirt-power8-models.patch Patch151: ppc64le-canonical-name.patch