From nobody Sun May 19 02:38:19 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1697027146; cv=none; d=zohomail.com; s=zohoarc; b=e36qxgso87vyEov7t09gbbmiKt8V1VNMbazDqUSxsT2/F7M5kTHPKkxvvFBOj05vssadBRE3uEnuK8qoIy5syRQPYtUlC+feue9jBx7IFYEEtgVkgB4tz5+k65bbQrDa0fffLYGuNL76JPoRq7WFbODXsJT6sdoWneyoXKkHoKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697027146; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=frrZrTP6tIbzwX4B32nO8jvcSuvV0z7MTJ3/fmCDftU=; b=JqrvfwuERdwjvyOgSaPABkeTmDfYU8OCM9Bq4ZKzep+yysVb6iU7AWT4yiJaQId++yRpmgONyqDfl5+SDuwAYPLCZXnTULhG9JvJy7I5TW0EiVk9Qkjh+GBwbmqcdYPqZ688I5xxMfLxpAfRxFNKCdC0ow4eJZvw2kEZX6t1MtI= 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 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 1697027146401763.7173477220141; Wed, 11 Oct 2023 05:25:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-116-hKNvCbJWM2q5JzowuQN6iQ-1; Wed, 11 Oct 2023 08:25:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 94BA51C0BB61; Wed, 11 Oct 2023 12:25:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B32DEC5796F; Wed, 11 Oct 2023 12:25:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 52CDC194658F; Wed, 11 Oct 2023 12:25:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 499581946586 for ; Wed, 11 Oct 2023 12:25:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 274D21B99; Wed, 11 Oct 2023 12:25:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2135C1B94 for ; Wed, 11 Oct 2023 12:25:12 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-inbound-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 0377A3826D2C for ; Wed, 11 Oct 2023 12:25:12 +0000 (UTC) Received: from exchange.fintech.ru (exchange.fintech.ru [195.54.195.159]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_DHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-iOAvvCXWPKyXcfNLxajWdQ-2; Wed, 11 Oct 2023 08:25:04 -0400 Received: from Ex16-02.fintech.ru (10.0.10.19) by exchange.fintech.ru (195.54.195.159) with Microsoft SMTP Server (TLS) id 14.3.498.0; Wed, 11 Oct 2023 15:24:34 +0300 Received: from infra.fintech.ru (10.10.1.240) by Ex16-02.fintech.ru (10.0.10.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 11 Oct 2023 15:24:29 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697027145; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=frrZrTP6tIbzwX4B32nO8jvcSuvV0z7MTJ3/fmCDftU=; b=EvdwNNvN7HTdkBhjJ0Esvf9JS6IsJVICHiMF1M5nKK72raQ02fYkEg+tLZoX2CapAfqfc+ xEEkfdrvZw0Q0AhpujL09IqPdHAAPDk84niJshOpt8oAJCe3Ayr1dqZCAHSL6GZmr+XuYS +pn8MIW19390LrehVycyua1awXYo5jc= X-MC-Unique: hKNvCbJWM2q5JzowuQN6iQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: iOAvvCXWPKyXcfNLxajWdQ-2 From: Sergey Mironov To: Subject: [PATCH 1/1] Checking the value returned by the function Date: Wed, 11 Oct 2023 15:24:17 +0300 Message-ID: <20231011122417.581121-2-mironov@fintech.ru> In-Reply-To: <20231011122417.581121-1-mironov@fintech.ru> References: <20231011122417.581121-1-mironov@fintech.ru> MIME-Version: 1.0 X-Originating-IP: [10.10.1.240] X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-02.fintech.ru (10.0.10.19) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergey Mironov Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: fintech.ru Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697027147741100001 Content-Type: text/plain; charset="utf-8" The virSecuritySELinuxSetFilecon function (by definition) always returns va= lues 0 or -1. The result of this function is written to 'ret'. The code compares the value of the variable 'ret' with 1. Signed-off-by: Sergey Mironov --- src/security/security_selinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index 7914aba84d..7bff780ddf 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -1988,7 +1988,7 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityMa= nager *mgr, ret =3D virSecuritySELinuxSetFilecon(mgr, path, use_label, remembe= r); } =20 - if (ret =3D=3D 1 && !disk_seclabel) { + if (ret =3D=3D -1 && !disk_seclabel) { /* If we failed to set a label, but virt_use_nfs let us * proceed anyway, then we don't need to relabel later. */ disk_seclabel =3D virSecurityDeviceLabelDefNew(SECURITY_SELINUX_NA= ME); --=20 2.31.1