From nobody Sat May 4 06:19:04 2024 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=1637933923; cv=none; d=zohomail.com; s=zohoarc; b=JPdetNayXm0ZFPQitP/zyWFT1cIR3B9WX5fx4ugMmKAoFvLcFZPUUvDRv+hrf0jmxpn9ZUrBBslJ7XnlNYy2JlI5cL6lXLlPJY0zawU6TlwpJs75kQni3DM5B7Ww0xercuhcPyKQ1ideBtqyTGyvJtAftfTrUUR0iDADTcF6h7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637933923; 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=RzvL+qKNdQlQIGKsAKXZ9V2J7BJxZkxXRUz5nTspaG8=; b=IeAlyZM9Y2Pk2PHDR0P1WGpCwUzsLlBPP07rSw6l72YhwN/lY9iyvyCXYwNXqVGbPueXjumLIBDjGz4dSJbvmFDD0bt14RO2De6rB34Kl/PKSvbtoJwpO+R76lRW9BBdDl6fhkdWaFd3LLayBBL2w+CXi/mgFAe+8rtzqTFHzpk= 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 1637933923118321.1526008183231; Fri, 26 Nov 2021 05:38:43 -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-295-eyM_jqoFOKiDNRYVvvz3Kg-1; Fri, 26 Nov 2021 08:38:38 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 237A093949; Fri, 26 Nov 2021 13:38:31 +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 ED9141002039; Fri, 26 Nov 2021 13:38:27 +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 028914BB7C; Fri, 26 Nov 2021 13:38:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AQDcLZX015787 for ; Fri, 26 Nov 2021 08:38:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 242E310016FE; Fri, 26 Nov 2021 13:38:21 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.192.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F19F1001F50; Fri, 26 Nov 2021 13:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637933922; 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=RzvL+qKNdQlQIGKsAKXZ9V2J7BJxZkxXRUz5nTspaG8=; b=IS8oUXVptrZTivvP0oOYj9a0wxh7/eI00qaCjEa/KU2HSXCv32UT1YTrpd9OGU0eFtvlYI WGrSf3fpQKkSos4gHW/Vp8FnOuM7X/aBT5bM9GBkT7aDq0urWkLjM6uCwCMqUvFkKWBs/x ePuQUHwzGJIhCoTWLW+6BDQlbDkmk6o= X-MC-Unique: eyM_jqoFOKiDNRYVvvz3Kg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] tools: fix iterating over argv when recovering xattr Date: Fri, 26 Nov 2021 13:38:17 +0000 Message-Id: <20211126133817.1626274-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.84 on 10.5.11.22 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: 1637933925166100001 The libvirt_recover_xattrs.sh tool hangs when run. It appears that calling 'shift' is not modifying the '$#' value, so the loop never terminates. Rewrite to just loop over $@ instead which involves less cleverness. Signed-off-by: Daniel P. Berrang=C3=A9 --- tools/libvirt_recover_xattrs.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/libvirt_recover_xattrs.sh b/tools/libvirt_recover_xattrs= .sh index be6ee84b5f..ae9a18bad8 100755 --- a/tools/libvirt_recover_xattrs.sh +++ b/tools/libvirt_recover_xattrs.sh @@ -104,11 +104,10 @@ fix_xattrs() { } =20 =20 -shift $((OPTIND - 1)) if [ $# -gt 0 ]; then - while [ $# -gt 0 ]; do - fix_xattrs "$1" - shift $((OPTIND - 1)) + for arg in "$@" + do + fix_xattrs "$arg" done else if [ ${UNSAFE} -eq 1 ]; then --=20 2.33.1