From nobody Sun Feb 8 13:53:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1637450038; cv=none; d=zohomail.com; s=zohoarc; b=bToP6kT9s9/K9yt/tLAb4avi35qj4TZmYHogDZ1dQakY/L5q9Xb96pplWqG9vhm5Lon11Fk9x8gpcoXGAOdOni4LJhA+nFidNPV37b/mU5zTx24mi+lyZjt5EhGwRpLMzUhcWkezx9dyZBfN1pptAwEN5ZYHhCtHsFc+6Ez//aU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637450038; 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=gbXsv+RkfKA9GZXz7q8C7z7HG9FgrPY77CwyaeInTL8=; b=Ti7S24uh8o+zzIkMUc5cjCCemNPKZqBYkxONNp7mO4pd30/6ZK/2rfGoZH+u9tgVVQVuKueOCaR2QFuyY7eGOFGCgg1ZdBehFdvz1O+1vwk8HVWzJH1q+VRYwUTBRAE//9hwZXZ5sfs4dMuL3HIv9aD0cXLaRklbj4toj+0Ihoc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1637450038142379.915452114677; Sat, 20 Nov 2021 15:13:58 -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-166-dbuU0ZyxOAGEAlPFjb-BsQ-1; Sat, 20 Nov 2021 18:13:53 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BC3E51006AA0; Sat, 20 Nov 2021 23:13:48 +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 9EB6960BF1; Sat, 20 Nov 2021 23:13:48 +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 6FB541832E80; Sat, 20 Nov 2021 23:13:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AKNAMdn001714 for ; Sat, 20 Nov 2021 18:10:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id B67DF2166B2F; Sat, 20 Nov 2021 23:10:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0BB62166B26 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 7738E80122B for ; Sat, 20 Nov 2021 23:10:21 +0000 (UTC) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-431-CgPG7fmCN3WoTLijDz1JHQ-1; Sat, 20 Nov 2021 18:10:19 -0500 Received: by mail-ed1-f69.google.com with SMTP id f4-20020a50e084000000b003db585bc274so11453327edl.17 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 mc3sm1719188ejb.24.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 280C9C20055 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=1637450037; 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=gbXsv+RkfKA9GZXz7q8C7z7HG9FgrPY77CwyaeInTL8=; b=dVQsa3lnDUX3vkPxLvj7VSYnz/6d+ALXrplB6ei1ayW32tm0w7Op/LN7bXgTW5Y+T8h1d0 xzQO2mLKhbV8ElhuMkw44UkLcG0nmEyqA0i8uG6Am5yzBPywOlQojvDDthIz2/nTe+OSmr xZtxmde2GD0QJMOtoUglbzKE5bMB9pg= X-MC-Unique: dbuU0ZyxOAGEAlPFjb-BsQ-1 X-MC-Unique: CgPG7fmCN3WoTLijDz1JHQ-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=gbXsv+RkfKA9GZXz7q8C7z7HG9FgrPY77CwyaeInTL8=; b=WxnfBeD88/uIeO+njRAIpXzPBsgpI1XjUTEcLucz1ZJ0cVaEDx51XvVha/AnAHup12 eQy9kbnKIg/ISWO1T7fy5D/4w8MGeey+l9Q8xV00fXrk7WYYMfeoV90VW2ePXFd5LS+a Lt0SuVWO5dZSjJAQjGSI6frOS42pF9st4XzbtugPNJBeo9RqgRfFJHGDfB54kxu/zqi5 sa/MCCIYffIKXKpvmQD7lTHUVl2mXHEm23/G9U/9EXuhK4uf7uo3qX+mPZKiGZQetaor h5sglUFxJTTY0NS6lFs7whgpmnjsAH+bGlB+PExWwUFjIfSfKCSHptXfsg9PbSJBVpt9 VPXQ== X-Gm-Message-State: AOAM532ymh+kHaEoJeUApOHO6735gn/DOgM8exBLYWFtn3IqIz9LKqck /p2sJoUNiXV4a1VjwdfLKoraRFgaHOkovjAc23B8DXozXYkvEGLikVctRjtW6kYMtw0aPq0KWml dIOjWz/SxACNA8blacLsAUxykc3S4gNI6kkkQygb+EaMR0loWyuUbmxTFB/wlI+lCK/uK14A= X-Received: by 2002:a17:906:4c56:: with SMTP id d22mr22957722ejw.1.1637449818392; Sat, 20 Nov 2021 15:10:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzy3dGx9TCaqXRpGWAuEu/55ulpcJgWRZJ3xvQ04GD2+uIFaXIn4XMjsDPxOnnUKD5jSI7E1Q== X-Received: by 2002:a17:906:4c56:: with SMTP id d22mr22957679ejw.1.1637449818056; Sat, 20 Nov 2021 15:10:18 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 5/7] util: Report errors in all code paths in virPolkitAgentCreate Date: Sun, 21 Nov 2021 00:10:06 +0100 Message-Id: <0a0bca6d66ada0f67c5e733c49e688b7a69879ea.1637449540.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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.79 on 10.5.11.12 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: 1637450039832100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander Reviewed-by: J=C3=A1n Tomko --- src/util/virpolkit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c index 3b333547d70b..63bb8133a8aa 100644 --- a/src/util/virpolkit.c +++ b/src/util/virpolkit.c @@ -180,8 +180,11 @@ virPolkitAgentCreate(void) int outfd =3D STDOUT_FILENO; int errfd =3D STDERR_FILENO; =20 - if (!isatty(STDIN_FILENO)) + if (!isatty(STDIN_FILENO)) { + virReportError(VIR_ERR_SYSTEM_ERROR, "%s", + _("Cannot start polkit text agent without a tty")); goto error; + } =20 if (virPipe(pipe_fd) < 0) goto error; @@ -205,8 +208,11 @@ virPolkitAgentCreate(void) pollfd.fd =3D pipe_fd[0]; pollfd.events =3D POLLHUP; =20 - if (poll(&pollfd, 1, -1) < 0) + if (poll(&pollfd, 1, -1) < 0) { + virReportSystemError(errno, "%s", + _("error in poll call")); goto error; + } =20 return agent; =20 --=20 2.34.0