From nobody Sun Feb 8 12:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637450068; cv=none; d=zohomail.com; s=zohoarc; b=JBVtkbw5WpEoSsQDwCqKiV1GbwbT0i1JJjX4BpdZbnoKbuDdIUhqoTH9MMt8Uf0YDeT1bLkmF7dcXzzwbd7SQLI7ykANPX5kw57i5ggjKCGj6wUoOeGkJIYJidFm/wba8W5Ym8fn4dBlrS6dD0YfvZnwV6DkUDRNwJGLfzGZw8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637450068; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yc3Dd5k6TeCI0E/JxxxZ44aG3ZXjTcNQ/BuuFKmr6Fc=; b=hSJm5D2S47vY2CaMl/T8mouCW9pUNvifVKj6J9+RcB6o94LH7viOS9vqVpYLlpz6iRMc/y53k2PyPMKfSt4AmTKLp6hRQISvYK7eMwLgwwhGClA5xI8RwHe6KAxKbBs/W5qGv3kWr42gF+DGl0DITG6mdLMYL9CrGZ73eC2LAFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 163745006812024.006291298132396; Sat, 20 Nov 2021 15:14:28 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-401-b6Kho8nINjyWkaugQ4EZag-1; Sat, 20 Nov 2021 18:14:23 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74E4518125C2; Sat, 20 Nov 2021 23:14:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 500CA19D9D; Sat, 20 Nov 2021 23:14:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 24B1F1832E86; Sat, 20 Nov 2021 23:14:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AKNAOUW001743 for ; Sat, 20 Nov 2021 18:10:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6881D112131B; Sat, 20 Nov 2021 23:10:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 635D11121315 for ; Sat, 20 Nov 2021 23:10:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C92A185A7B4 for ; Sat, 20 Nov 2021 23:10:21 +0000 (UTC) Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-107-kMiJjuI2PIq6BeuMyvgFGQ-1; Sat, 20 Nov 2021 18:10:19 -0500 Received: by mail-ed1-f72.google.com with SMTP id v1-20020aa7cd41000000b003e80973378aso9951503edw.14 for ; Sat, 20 Nov 2021 15:10:19 -0800 (PST) Received: from carol.localdomain (k8r.cz. [95.82.177.71]) by smtp.gmail.com with ESMTPSA id nd36sm1718024ejc.17.2021.11.20.15.10.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Nov 2021 15:10:17 -0800 (PST) Received: from carol.redhat.com (carol.k8r.cz [IPv6:::1]) by carol.localdomain (Postfix) with ESMTP id 288C6C20056 for ; Sun, 21 Nov 2021 00:10:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637450067; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yc3Dd5k6TeCI0E/JxxxZ44aG3ZXjTcNQ/BuuFKmr6Fc=; b=gLf95f6dJtecGfPBXKAQRJGF7qcP/wi9EH8IreTG9G2BeeZHA0EggVAgCiKQJNSio7/Mmx F4x0Ga0kVq5BlraODWksxE3s+ooNre+F0LoQgrRG82Y5KtUqWI9taPWhKUNjXrFXbNZ8SL YAnCvyQI/QqxPY6CqmWTj8cWw2JnsD4= X-MC-Unique: b6Kho8nINjyWkaugQ4EZag-1 X-MC-Unique: kMiJjuI2PIq6BeuMyvgFGQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yc3Dd5k6TeCI0E/JxxxZ44aG3ZXjTcNQ/BuuFKmr6Fc=; b=uduFOxhwIMh6Xc96XvJ86L8ovRpoUVRb4qfTKGZgZ3PuRmeEq25dq9Ftaq+ZeMRMzf TZ0QMCYNaHV9sQnULGa4FOQwBro2wCOd8O1e5mWoSjc1+lYRC6q0AiyqL3bi+QOqdds4 Uvho8ZWcg+wK/z7Us/AXUxL2uSh33EZ8YgxluTMOuYLn6SoNOw9uCGs3JN/ZF/k1nayd 0rrUBFxZE+/ELGeVYA8bQntMpyjs14PH8nmCdOpRCtW8VVdlHMZp8DA2PhFcHVPZXr0g CLLYg7A1EdejUDTfM+O8wlCu6FySz/V6jmAfz3gdwej69S4Stq9OuoF+ezF9rcn28uWa 2XVg== X-Gm-Message-State: AOAM532hLuwvn4wpSQIZaWyDUkcv3Oi9cOfXXPlsmdH33X7CtEsY8FXu hGSzmn9yTLchQyHD/v9lo9wj+Xkrl/q/M7ze57NdbBUs7Om/fj7DY61kD5XtaqWi0B7XY77fhiT dTUIHHJHwJ2drlcP3jtZn5eEZ0pWaTEoRRjcQie54Aplv5tw0a8PZUYUNFnQAvYlZM/i9g2w= X-Received: by 2002:a50:d88a:: with SMTP id p10mr42938328edj.274.1637449818444; Sat, 20 Nov 2021 15:10:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJztks/niJeCKH3CsGRom3rE4cPAsuUlAMCrUHooUB4Hh1mk690D5p3O/ZywCuzf2gfOw2KG0g== X-Received: by 2002:a50:d88a:: with SMTP id p10mr42938293edj.274.1637449818267; Sat, 20 Nov 2021 15:10:18 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 6/7] util: Check for pkttyagent availability properly Date: Sun, 21 Nov 2021 00:10:07 +0100 Message-Id: <6498ff1c90e21df99e46cd021adf1244d45b926c.1637449540.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637450069021100001 Content-Type: text/plain; charset="utf-8" It does not need a tty to work, it opens its controlling terminal for user interaction and with this patch even crazy things like this work: echo 'list --name' | virsh -q >/dev/null Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- src/util/virpolkit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c index 63bb8133a8aa..7156adc10c0a 100644 --- a/src/util/virpolkit.c +++ b/src/util/virpolkit.c @@ -180,9 +180,9 @@ virPolkitAgentCreate(void) int outfd =3D STDOUT_FILENO; int errfd =3D STDERR_FILENO; =20 - if (!isatty(STDIN_FILENO)) { + if (!virPolkitAgentAvailable()) { virReportError(VIR_ERR_SYSTEM_ERROR, "%s", - _("Cannot start polkit text agent without a tty")); + _("polkit text authentication agent unavailable")); goto error; } =20 --=20 2.34.0