SHA256
1
0
forked from pool/libvirt
libvirt/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch
James Fehlig 4e3b0799c4 Accepting request 1068569 from home:jfehlig:branches:Virtualization
- Update to libvirt 9.1.0
  - Many incremental improvements and bug fixes, see
    https://libvirt.org/news.html#v9-1-0-2023-03-01
  - spec: Remove obsolete Groups tag
  - spec: Integrate upstream spec file changes that split the
    libvirt-daemon package, allowing more modular, customized
    installations
  - spec: New subpackages libvirt-daemon-common, libvirt-daemon-lock,
    libvirt-daemon-log, libvirt-daemon-proxy, and
    libvirt-daemon-plugin-lockd
  - spec: Renamed subpackage libvirt-lock-sanlock to
    libvirt-daemon-plugin-sanlock
  - Dropped patches:
    ef482951-apparmor-Allow-umount-dev.patch,
    d6a8b9ee-qemu-Fix-managed-no-when-creating-ethdev.patch,
    c3f16cea-qemu-cleanup-label-on-umount-failure.patch,
    697c16e3-qemu_process-better-debug-message.patch,
    5155ab4b-qemu_namespace-nested-mounts-when-umount.patch

OBS-URL: https://build.opensuse.org/request/show/1068569
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=968
2023-03-02 00:49:27 +00:00

35 lines
1.4 KiB
Diff

From be595e5e9e9bc8fa3fdd94358b1c92bd8b30b0eb Mon Sep 17 00:00:00 2001
From: Jim Fehlig <jfehlig@suse.com>
Date: Tue, 5 Jul 2022 11:21:45 -0600
Subject: 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 <mkletzan@redhat.com>
---
src/util/virpolkit.c | 3 +++
1 file changed, 3 insertions(+)
Index: libvirt-9.1.0/src/util/virpolkit.c
===================================================================
--- libvirt-9.1.0.orig/src/util/virpolkit.c
+++ libvirt-9.1.0/src/util/virpolkit.c
@@ -235,6 +235,9 @@ virPolkitAgentAvailable(void)
const char *termid = ctermid(NULL);
VIR_AUTOCLOSE fd = -1;
+ if (!isatty(STDIN_FILENO))
+ return false;
+
if (!virFileIsExecutable(PKTTYAGENT))
return false;