From nobody Sun Apr 28 04:38:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1614617625; cv=none; d=zohomail.com; s=zohoarc; b=kVQZXrfkUIuJha77QRA8GvDIq9koevsTIk4CbQ+BxSZkWXIUw887bF38YjvY9DPhoiHldOHvEy31Gke6u4lP05Wc9A0DvPoTDPQoCSOiqILIuDaxsaAYBY2C37hDptR4REiz5Yo+Oytfn5R0YFh3FDDYgtgBgOqn2CCJB6grg7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614617625; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=sLMQr/sA+ZP3Ye96T5Jez1I6AVwd7/qK5vKMUyVfCwA=; b=IZJifxLQA8y5O6DPg+ZQFgAHLAuX+Am+t+4m/ktp+NZP5/MmPm24mwfpDXQcApY+51mNwCDS2keLc+g+WXT+NPDmXWpLvtyP1QC/LmcVd1Pr1gGZe76fpFi34j3Rl5tQOaEbAh/8dZzJI+QfZsQoUre8+KF8Bc4khz0BFK+sGF0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1614617625079964.2236347243789; Mon, 1 Mar 2021 08:53:45 -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-162-jS2qQAqZP0SUGs541BZclg-1; Mon, 01 Mar 2021 11:53:40 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B0E6C107ACC7; Mon, 1 Mar 2021 16:53:33 +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 4CB98620DE; Mon, 1 Mar 2021 16:53:31 +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 124AF18095CB; Mon, 1 Mar 2021 16:53:28 +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 121GrR4j001913 for ; Mon, 1 Mar 2021 11:53:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0300360BFA; Mon, 1 Mar 2021 16:53:27 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79C1360BF1 for ; Mon, 1 Mar 2021 16:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614617624; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sLMQr/sA+ZP3Ye96T5Jez1I6AVwd7/qK5vKMUyVfCwA=; b=alDTXDUTcCHiGNh0dS7gOyVgIfXDiW+AlhwwF9ltT1QR0O+IYfo3oTA6n0uzAyvLFchfV+ A0xVCjXiCA5cp34BiznQye23sayzWnfDvWV0HlrGdVw5vsUH16J9v4X29w+iDLS2neuDKO h8WRUVV1psfJUC9gEo+SmEQSnxy0eaU= X-MC-Unique: jS2qQAqZP0SUGs541BZclg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] tools: Fix dry run of libvirt_recover_xattrs.sh Date: Mon, 1 Mar 2021 17:53:21 +0100 Message-Id: <5bd9e35b9b7882b010882d93b8dee33fd3a4c44f.1614617601.git.mprivozn@redhat.com> 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.11 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The libvirt_recover_xattrs.sh script can be used to remove stale XATTRs that were left behind by secdrivers (which should happen only if there' an imbalance between set and restore calls). Anyway, the script has '-n' switch which is supposed to perform just a dry run, i.e. just to report which files have XATTRs set without any attempt to remove them. But, when rewriting the script a few months ago a typo was introduced which made the script report no files even if there were files with XATTRs. Fixes: 5377177f80da40ee7d47601400b50835f093715a Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tools/libvirt_recover_xattrs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libvirt_recover_xattrs.sh b/tools/libvirt_recover_xattrs= .sh index 59f1f3f476..be6ee84b5f 100755 --- a/tools/libvirt_recover_xattrs.sh +++ b/tools/libvirt_recover_xattrs.sh @@ -90,7 +90,7 @@ fix_xattrs() { =20 for i in $(getfattr -R -d -m ${XATTR_PREFIX} --absolute-names ${DIR} 2= >/dev/null | grep "^# file:" | cut -d':' -f 2); do if [ ${DRY_RUN} -ne 0 ]; then - getfattr -d -m $p --absolute-names $i | grep -v "^# file:" + getfattr -d -m ${XATTR_PREFIX} --absolute-names $i continue fi =20 --=20 2.26.2