From nobody Fri May 17 11:28:57 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=1697034780; cv=none; d=zohomail.com; s=zohoarc; b=kxpQNwGWz/C3KELamF4cINbQjBSod4VXJAEqPn5phRWMV+CErsXl0M+dW3GOWoJhWSBx070gt+FCnjylHUW8XiIlWcIdbZfkEbheK05yVJrZe5cjZhaH7yXK2j3RcQE8ZAKAc2PcHUm0eMQhWn0oQkvjdHq8dBLzrOwGEOATMww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697034780; 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=Z+Njw/yGc8XAA54SGhom74E9Do1UzWE3L0u6nhYRy2A=; b=SDAV6LM42IbHXCljTvJPpAKna9oxyfTzSEl1xZwixq+RfOUgI7EsZClqGUEKE8E8JzJhm+YhEW5axu8Sc3YEBLhv4mz//YzODRCMh3/WoAA5pqDDCA0MKoKGFyugbYO91ubSo3fzX79FxgMrm7TrxcbhzIyIGrBgrITpQ+/cmSY= 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 1697034780024386.15100443088386; Wed, 11 Oct 2023 07:33:00 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-VhFjO-q-NUaXDjKezQS5Cg-1; Wed, 11 Oct 2023 10:32:53 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 9710B10334AC; Wed, 11 Oct 2023 14:32:50 +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 7F7F11C060B0; Wed, 11 Oct 2023 14:32:50 +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 24FC01946597; Wed, 11 Oct 2023 14:32:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2F65C19466E5 for ; Wed, 11 Oct 2023 14:32:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E6CA263F55; Wed, 11 Oct 2023 14:32:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DEB289A for ; Wed, 11 Oct 2023 14:32:48 +0000 (UTC) Received: from us-smtp-inbound-delivery-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 AFDD43C23FDD for ; Wed, 11 Oct 2023 14:32:48 +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-591-mhRKRqArPTuUcQUZBxfAhA-2; Wed, 11 Oct 2023 10:32:45 -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 17:32:07 +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 17:32:07 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697034778; 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=Z+Njw/yGc8XAA54SGhom74E9Do1UzWE3L0u6nhYRy2A=; b=SyTHEfoNYUExauQQ10g7vJO1A7OYPa2qpQTeu10orqF/yOd4QeMNJ7g9ZceMLceAFcGuOR VIvj3l6VlHQrRu+vFcl975TIpmqeUb4o3jdncTIpw2Bn24MonGbS+aKmTOAD/Rj3NA8L3y vfCvnESO6ljwrhADCG6sLTnbjfJw0Lw= X-MC-Unique: VhFjO-q-NUaXDjKezQS5Cg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: mhRKRqArPTuUcQUZBxfAhA-2 From: Sergey Mironov To: Subject: [PATCH 1/1] Checking the value returned by the function Date: Wed, 11 Oct 2023 17:31:55 +0300 Message-ID: <20231011143155.901436-2-mironov@fintech.ru> In-Reply-To: <20231011143155.901436-1-mironov@fintech.ru> References: <20231011143155.901436-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.1 on 10.11.54.5 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: "sdl . qemu" , Sergey Mironov Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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: 1697034781033100002 Content-Type: text/plain; charset="utf-8" In version 0.10.0-rc0 (https://github.com/libvirt/libvirt/blob/v0.10.0-rc0/= src/security/security_selinux.c ) 11 years ago, the virSecuritySELinuxSetFileconHelper function appeared, which returned 1 = if the optional is true. Considering that at the moment the virSecuritySELinuxSetFilecon function (b= y definition) can only return 0 or -1, I suggest removing the "dead code" i= n the current patch. Co-developed-by: sdl.qemu Signed-off-by: Sergey Mironov Reviewed-by: Michal Privoznik --- src/security/security_selinux.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index 7914aba84d..a7abab9cf8 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -1988,17 +1988,6 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityM= anager *mgr, ret =3D virSecuritySELinuxSetFilecon(mgr, path, use_label, remembe= r); } =20 - 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); - if (!disk_seclabel) - return -1; - disk_seclabel->labelskip =3D true; - VIR_APPEND_ELEMENT(src->seclabels, src->nseclabels, disk_seclabel); - ret =3D 0; - } - return ret; } =20 --=20 2.31.1