From nobody Sun May 5 18:39:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150050654186177.31830753168015; Wed, 19 Jul 2017 16:22:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5FF47F3F1; Wed, 19 Jul 2017 23:22:19 +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 8B68D627DE; Wed, 19 Jul 2017 23:22: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 CF45E1853E30; Wed, 19 Jul 2017 23:22:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6JNMD17011837 for ; Wed, 19 Jul 2017 19:22:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCC1578437; Wed, 19 Jul 2017 23:22:13 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-116-50.phx2.redhat.com [10.3.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id F321778433; Wed, 19 Jul 2017 23:22:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E5FF47F3F1 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E5FF47F3F1 From: Cole Robinson To: libvir-list@redhat.com Date: Wed, 19 Jul 2017 19:22:09 -0400 Message-Id: <028a4c540436d1d1bdc805540bead745cbcbd9d8.1500506519.git.crobinso@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Molly.Jo.Bault@ballardtech.com Subject: [libvirt] [PATCH] security: Don't overwrite error of GetProcessLabel 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 19 Jul 2017 23:22:20 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Security impls of this function already raise errors, don't overwrite them. Signed-off-by: Cole Robinson --- src/lxc/lxc_driver.c | 6 ++---- src/qemu/qemu_driver.c | 7 +------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 652e9cba0..088d3d20f 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1348,11 +1348,9 @@ static int lxcDomainGetSecurityLabel(virDomainPtr do= m, virSecurityLabelPtr secla } =20 if (virSecurityManagerGetProcessLabel(driver->securityManager, - vm->def, priv->initpid, secl= abel) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Failed to get security label")); + vm->def, priv->initpid, + seclabel) < 0) goto cleanup; - } } =20 ret =3D 0; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 8d261b725..62d5b8dfe 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6111,11 +6111,8 @@ static int qemuDomainGetSecurityLabel(virDomainPtr d= om, virSecurityLabelPtr secl */ if (virDomainObjIsActive(vm)) { if (qemuSecurityGetProcessLabel(driver->securityManager, - vm->def, vm->pid, seclabel) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Failed to get security label")); + vm->def, vm->pid, seclabel) < 0) goto cleanup; - } } =20 ret =3D 0; @@ -6173,8 +6170,6 @@ static int qemuDomainGetSecurityLabelList(virDomainPt= r dom, for (i =3D 0; i < len; i++) { if (qemuSecurityGetProcessLabel(mgrs[i], vm->def, vm->pid, &(*seclabels)[i]) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Failed to get security label")); VIR_FREE(mgrs); VIR_FREE(*seclabels); goto cleanup; --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list