From patchwork Wed Jul 19 23:22:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 108314 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1394328qge; Wed, 19 Jul 2017 16:22:21 -0700 (PDT) X-Received: by 10.55.163.3 with SMTP id m3mr2384212qke.118.1500506541562; Wed, 19 Jul 2017 16:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500506541; cv=none; d=google.com; s=arc-20160816; b=zdyqqW4pu+DkI9uoFY4vhc0L0D0jST+qccnk+vwpcUH5yA+E+3tILZvFnF5Txyf3EP ngRZWFCQDvNbAuBIPVaxGMpPmedCljBWPChWRUZye9GNwiT08ft4XNHYdV0bU6KeIqor OEO1f1SKtskQ3HArOU2T71FR5bcZLypUlHmtyBJ+Gn27EwhB1NGIQM8NzLUi56hObPnG naafxhdQwL5GnFSsClMDen3SK6N3tUDXs3XZk+SCxEDkpcaF295quMkp/nsaH95zDggg yVwJfPgd2gXINX3ACkjhHsyGOifh7ndXYlZQ5iImqwIAZIs+xi43glXcIXWAKCEA79ch sUeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from:delivered-to :dkim-filter:dmarc-filter:arc-authentication-results; bh=7irTJ0VQcltOgmRVTVrENbRdMz7vwWsYWlzPPa2s920=; b=xf/zO4IdIJQGDfjPNFQAsEnZuKr1k8FpjhgllIMO3InirHnCUi8bQ2SIV+Y+TPE7W8 CA91Td4hecsP1y3xLZ40tR2udyoY8b08z5gP6vTl+bMT45+A+JtpOOGWwTLg/zmg9ncU eFK6+YDWRD8UoJhshn11M7hVpgUuZS5RJfKP14Vliz1mu4dN6cU3NGvbnvzni6Ca04WE aMSUzQU0xWadjpf4Oy5CSfx1ojtTjiRrRw7S0O0YbFbVyXpaErbq9t3YgDCzgGcA11d/ aYYBW5nwM1NVPXcfiUCSJuPQ9UkKmEsgReUi8VN9TFOWBGsYwPqsWfgl/Ze1s0YsEojE SFqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id u15si913056qte.207.2017.07.19.16.22.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jul 2017 16:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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) 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 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) Delivered-To: libvir-list@redhat.com 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) 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 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) 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(-) -- 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list 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 dom, virSecurityLabelPtr secla } if (virSecurityManagerGetProcessLabel(driver->securityManager, - vm->def, priv->initpid, seclabel) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("Failed to get security label")); + vm->def, priv->initpid, + seclabel) < 0) goto cleanup; - } } ret = 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 dom, 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; - } } ret = 0; @@ -6173,8 +6170,6 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom, for (i = 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;