From nobody Thu May 16 01:25:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1607582424; cv=none; d=zohomail.com; s=zohoarc; b=Kg941vgpXS9dwSyCkKzEyxn2iYrPN1suyOtq4Z8r9/IDHJRc7ZUZCEqeP5uaKC1F51cqxF/ItBTFJr1YBRJ0c09GiV31dxOjsDYstWnq0Hcgs6dNizCMcXM3UCOmesSZ2YOUEPFO9kSnmIZ7Ulp76xgWymsaLcvCvDPtwMaZfCo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607582424; h=Content-Type:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=zFhnmFf2zvnJHHZLm3/qqtn8ejfPkdBR89UBeqMBeFA=; b=T1qt4G+GaeaRGKVBFTdEY2JGx2F298lTwsdgpnt/xLfERlQ1XxHYqT00Akfx+Gl1TUMXPcslWRO/vCveesFFbdCOF3jPGM1fT3mh+j/fF5U8+5WIqcjchpMbKrGqtf+qiHUYKYxGrgLS0w/OfcQ6vZPEx9x/pZhDHLnMR6GuUZU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607582423790734.2506071135741; Wed, 9 Dec 2020 22:40:23 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-285-t0OaM5JTNbCUGzbscrMh4A-1; Thu, 10 Dec 2020 01:40:19 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C66C45204; Thu, 10 Dec 2020 06:40:12 +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 022466F968; Thu, 10 Dec 2020 06:40: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 8A62718095C9; Thu, 10 Dec 2020 06:40:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BA6e2NV029303 for ; Thu, 10 Dec 2020 01:40:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 43394D74CE; Thu, 10 Dec 2020 06:40:02 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D7C3D74C7 for ; Thu, 10 Dec 2020 06:39:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E5CB9858280 for ; Thu, 10 Dec 2020 06:39:59 +0000 (UTC) Received: from relay3.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-Ta5kJPH2N0Oc7yy_3A4N4A-1; Thu, 10 Dec 2020 01:39:56 -0500 Received: from [10.28.15.168] (helo=vz7.sw.ru.) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from ) id 1knFc6-00CUzO-9v for libvir-list@redhat.com; Thu, 10 Dec 2020 09:39:42 +0300 X-MC-Unique: t0OaM5JTNbCUGzbscrMh4A-1 X-MC-Unique: Ta5kJPH2N0Oc7yy_3A4N4A-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH v3] spec: don't touch existing nwfilters on update Date: Thu, 10 Dec 2020 09:39:31 +0300 Message-Id: <1607582371-960514-1-git-send-email-nshirokovskiy@virtuozzo.com> 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-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Nwfilter can be edited by the user and we don't want to overwrite the editi= ngs. Also the filters in %{datadir} does not have UUIDs and these are generated = on libvirtd start. Thus this patch also fixes regeneration of UUIDs on libvirtd update. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Michal Privoznik --- It is a successor to PATCH v2[1]. Diff to v2: - Misc changes according to Andrea's review [1] PATCH v2 https://www.redhat.com/archives/libvir-list/2020-December/msg00399.html =20 libvirt.spec.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 880051b..f20a1c7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1439,9 +1439,13 @@ fi rm -rf %{_localstatedir}/lib/rpm-state/libvirt || : =20 %post daemon-config-nwfilter -cp %{_datadir}/libvirt/nwfilter/*.xml %{_sysconfdir}/libvirt/nwfilter/ -# libvirt saves these files with mode 600 -chmod 600 %{_sysconfdir}/libvirt/nwfilter/*.xml +for datadir_file in %{_datadir}/libvirt/nwfilter/*.xml; do + sysconfdir_file=3D%{_sysconfdir}/libvirt/nwfilter/$(basename "$datadir_f= ile") + if [ ! -f "$sysconfdir_file" ]; then + # libvirt saves these files with mode 600 + install -m 0600 "$datadir_file" "$sysconfdir_file" + fi +done # Make sure libvirt picks up the new nwfilter defininitons mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : touch %{_localstatedir}/lib/rpm-state/libvirt/restart || : --=20 1.8.3.1