From nobody Tue May 7 09:57:52 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=none dis=none) header.from=gmail.com 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 1636966743511279.94113999308206; Mon, 15 Nov 2021 00:59:03 -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-575-MJ4jzgOPM4K11x8SUEQd8w-1; Mon, 15 Nov 2021 03:58:58 -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 AA0E315721; Mon, 15 Nov 2021 08:58:53 +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 6475157CAB; Mon, 15 Nov 2021 08:58:53 +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 EA7CE4E58F; Mon, 15 Nov 2021 08:58:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AE675mL000395 for ; Sun, 14 Nov 2021 01:07:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8C46D1121318; Sun, 14 Nov 2021 06:07:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87E531121315 for ; Sun, 14 Nov 2021 06:07:02 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (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 959BD811E76 for ; Sun, 14 Nov 2021 06:07:02 +0000 (UTC) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-huko5s5-NXSvsAFqQfPpyA-1; Sun, 14 Nov 2021 01:07:00 -0500 Received: by mail-pl1-f169.google.com with SMTP id q17so11695605plr.11 for ; Sat, 13 Nov 2021 22:07:00 -0800 (PST) Received: from localhost.localdomain (fpa0565fa6.aicf508.ap.nuro.jp. [160.86.95.166]) by smtp.gmail.com with ESMTPSA id mn15sm8942391pjb.35.2021.11.13.22.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Nov 2021 22:06:58 -0800 (PST) X-MC-Unique: MJ4jzgOPM4K11x8SUEQd8w-1 X-MC-Unique: huko5s5-NXSvsAFqQfPpyA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4k2tVzXpfbyYlO0aWKiMlFTejqf+6uQ/aTn40hSheMk=; b=rWhiipe/8ZGj+mVwTUKfhnsI4g5tmGt67LAY4bz5VhVNpMSWm7DaGy+1OWXcrJyWeI Wur+QDZfeGMpNOnGxPwMMK6qMJzks8ucTL8dUNsfIu+en0JPcC9m7kft4Xr6brzQHu25 Gk8eZsvmhJd3iYsyZ733XYUFSicIC3rdcpKqueh9IRF9cG7rhpoGjK9IbQcjE37fEj8+ zSqFgdzzk3mr6v27Cz7sv8L5W0hEq66VzIIP/1z1hhLydm9VpSbvWVYYZU4oLOCt+m72 TO/yaqg84TsVgaGlQd9kNqre3Y40nnQBUz5nQ553i+ArAFLVILbdyNCiHi+lWJn71UPw puaA== X-Gm-Message-State: AOAM531cjqROrmXseaAQN1E5yeggJo/JaYOkmgTacrdgL8NkcayEE3Ur BAjGU795D+i1f1V/DRIwJWoXP49VxoM= X-Google-Smtp-Source: ABdhPJwLKCotXwMaDvdD8iCd/u88+PgixTPBOTttralV8n6NrLqIyNNlSpAy862v/rOfi8zjkmoW4w== X-Received: by 2002:a17:902:6941:b0:142:5b55:28a6 with SMTP id k1-20020a170902694100b001425b5528a6mr23793629plt.31.1636870019235; Sat, 13 Nov 2021 22:06:59 -0800 (PST) From: Koichi Murase To: libvir-list@redhat.com Subject: [PATCH 1/1] bash-completion: fix variable leaks of "IFS" and "word" Date: Sun, 14 Nov 2021 15:06:40 +0900 Message-Id: <20211114060640.2124-2-myoga.murase@gmail.com> In-Reply-To: <20211114060640.2124-1-myoga.murase@gmail.com> References: <20211114060640.2124-1-myoga.murase@gmail.com> MIME-Version: 1.0 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 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 15 Nov 2021 03:58:35 -0500 Cc: Koichi Murase 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-ZM-MESSAGEID: 1636966744932100001 Content-Type: text/plain; charset="utf-8" Reviewed-by: Michal Privoznik --- tools/bash-completion/vsh.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in index 70ade50a02..4399ff0a64 100644 --- a/tools/bash-completion/vsh.in +++ b/tools/bash-completion/vsh.in @@ -4,7 +4,7 @@ =20 _@command@_complete() { - local words cword c=3D0 i=3D0 cur RO URI CMDLINE INPUT A + local words cword c=3D0 i=3D0 cur word RO URI CMDLINE INPUT A =20 # Here, $COMP_WORDS is an array of words on the bash # command line that user wants to complete. However, when @@ -56,7 +56,8 @@ _@command@_complete() # the name of the command whose arguments are being # completed. # Therefore, we might just run $1. - IFS=3D$'\n' A=3D($($1 ${CMDLINE[@]} complete -- "${INPUT[@]}" 2>/dev/n= ull)) + local IFS=3D$'\n' + A=3D($($1 ${CMDLINE[@]} complete -- "${INPUT[@]}" 2>/dev/null)) =20 COMPREPLY=3D($(compgen -W "${A[*]%--}" -- ${cur})) __ltrim_colon_completions "$cur" --=20 2.21.3