From nobody Sun Apr 28 00:15:01 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637941661; cv=none; d=zohomail.com; s=zohoarc; b=JLysycude5IMkRRQlivvctpzjThQ7yfIckIPnMO7auV3WOG+i4rVuaR9YuL5neEvco1rDRUcxzAILe4O9lE6Zrc2iKdxbhWUlQ9H7RN7tOEcTpJVpn+Qgec3JKkUSuSnsWXMTA1LDxg/p7W5IpHUUYhTWaRYnb+YHtbkOpurLH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637941661; 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=yNUntZXHDWNEcR0KksQdSC5c9RJ4xWklJHqLeLSJpM8=; b=jZXOOOoSjhGFkeCGqp23f3pzIrxCYiX1xAH/Sx26W1mh0fU1U+JIzda2rpSurhqOnhrMr/4ldOfXQzPqvKd1F3Ra1b6OuXbQSyQNXnYO6A0y55dercyyoP1A5rmdb5oeqpO6kzQdb/VG4iscghjZQDTmPdxrDOtppMC+AZ3LmOg= 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; 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.133.124]) by mx.zohomail.com with SMTPS id 1637941661807110.83383160509823; Fri, 26 Nov 2021 07:47:41 -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-390-b7jVU-0pNUqGKHfGe8Ex6w-1; Fri, 26 Nov 2021 10:47:39 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F114100D684; Fri, 26 Nov 2021 15:47:34 +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 3536779455; Fri, 26 Nov 2021 15:47:34 +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 0B87A180BAD2; Fri, 26 Nov 2021 15:47:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AQFlXDP027003 for ; Fri, 26 Nov 2021 10:47:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 92FFC79455; Fri, 26 Nov 2021 15:47:33 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.192.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1608679459; Fri, 26 Nov 2021 15:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637941660; 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=yNUntZXHDWNEcR0KksQdSC5c9RJ4xWklJHqLeLSJpM8=; b=L0LNLv9VWXW+kVYw+ZPFAACvbVvXd0Rnd4HbfcBxrhM2vHa+zhQ3YHYQmDw/aZZtIYR62w 2tZk0qxM5pDyRwUnFiDwThIvGtW4gp6y9gil8jvl3hOT8gTzyIgXTDFBzBav1BLTIABoMF ufrs3AjSXPubkmlvlpE/myIfxFvDrsY= X-MC-Unique: b7jVU-0pNUqGKHfGe8Ex6w-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH v2] tools: fix iterating over argv when recovering xattr Date: Fri, 26 Nov 2021 15:46:56 +0000 Message-Id: <20211126154656.1655057-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.16 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: 1637941662495100001 The libvirt_recover_xattrs.sh tool hangs when run. When not flags are provided OPTIND is 1, so the loop expands to 'shift 0' which has not effect. Rewrite to just loop over $@ instead which involves less cleverness. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Martin Kletzander --- tools/libvirt_recover_xattrs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libvirt_recover_xattrs.sh b/tools/libvirt_recover_xattrs= .sh index be6ee84b5f..35c164a9c7 100755 --- a/tools/libvirt_recover_xattrs.sh +++ b/tools/libvirt_recover_xattrs.sh @@ -106,9 +106,9 @@ fix_xattrs() { =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