From nobody Mon Feb 9 16:02:40 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=1639152443; cv=none; d=zohomail.com; s=zohoarc; b=Kl2lrzhMhHUJdwxZZ84D1kPHPayHzoiVdkiSt1asewkCE3JKBAcQzGJDh+Uq/VgJQ2q+2+E8EhZpH6VOUxQ0a1rV5lxfCoqDTy073NnL3cA5NdQSnzJnrvI5UVfHM4gaMhkJP2bUGuKhMC4mYRheJc/lgbjwl1x184ZQliKY9MI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639152443; 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=QQU1tLvB82CIgWfP+bUXWcL7i4r/lCBfO+o9zrKZI4w=; b=G4RvmhDAGs8LolE+5kZ5IyQJxtBRGOUU+/SE4wSkdig3c5gyw63OD7gNpfCpdLZIQnyL49AKHKbP6TG0ExYzEqyVMuc1sSJ4vj1eB+JQMHPkoJhDipsyM8dcPg9cCk3Sr7baWQODy/fG2r/vj6OHo9yRZ5PpixTIeoMw+hQaPPM= 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 16391524438711009.1065833471275; Fri, 10 Dec 2021 08:07:23 -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-515-XkkVPMTmOVSsLosLJHYrpw-1; Fri, 10 Dec 2021 11:07:19 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 723F181EE60; Fri, 10 Dec 2021 16:07:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89E555DF37; Fri, 10 Dec 2021 16:07:10 +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 B4D574BB7C; Fri, 10 Dec 2021 16:07:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BAG6Lns015217 for ; Fri, 10 Dec 2021 11:06:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id F40D060BF4; Fri, 10 Dec 2021 16:06:20 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BC9360C04 for ; Fri, 10 Dec 2021 16:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639152442; 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=QQU1tLvB82CIgWfP+bUXWcL7i4r/lCBfO+o9zrKZI4w=; b=AgZwZUCMbov+ClFahnBAL8yj8yFBs8RjZSbrulQbfuElFUwLHg7BPTE7My7FQXVUit01SO ci4HYYFXLJGDqHsbAs/wJWRbpSmLhX6Bgkg4agYf1RxowYoML49bIhq863CxOEHycDV+MF UJz6iJn3ANKhW0bd6Bc+Bxpz2vipmZk= X-MC-Unique: XkkVPMTmOVSsLosLJHYrpw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/8] lxc: fix error value of lxcNodeGetSecurityModel Date: Fri, 10 Dec 2021 17:06:11 +0100 Message-Id: <543d2fed9bf69980ff6e9554219221e695e4f603.1639152235.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.14 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639152446149100001 When adding the ACL check and caps getter, we assumed that the default return value is -1, not 0 as usual. Fix the return value on error by assigning them explicitly. Signed-off-by: J=C3=A1n Tomko --- src/lxc/lxc_driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 349783ca7c..d86147cc28 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1234,11 +1234,15 @@ static int lxcNodeGetSecurityModel(virConnectPtr co= nn, =20 memset(secmodel, 0, sizeof(*secmodel)); =20 - if (virNodeGetSecurityModelEnsureACL(conn) < 0) + if (virNodeGetSecurityModelEnsureACL(conn) < 0) { + ret =3D -1; goto cleanup; + } =20 - if (!(caps =3D virLXCDriverGetCapabilities(driver, false))) + if (!(caps =3D virLXCDriverGetCapabilities(driver, false))) { + ret =3D -1; goto cleanup; + } =20 /* we treat no driver as success, but simply return no data in *secmod= el */ if (caps->host.nsecModels =3D=3D 0 --=20 2.31.1