From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24107 invoked by alias); 13 Apr 2017 17:55:17 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40970 Received: (qmail 10209 invoked from network); 13 Apr 2017 17:55:17 -0000 X-Qmail-Scanner-Diagnostics: from ulminfo.fr by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(5.135.188.139):SA:0(0.0/5.0):. Processed in 1.997034 secs); 13 Apr 2017 17:55:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: a3nm@a3nm.net X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at a3nm.net designates 5.135.188.139 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=a3nm.net; s=default; t=1492105637; bh=9CA7Xi3TcX+bDRRBGAnhP9Ue+Rx6rdabAwlEFEguWgU=; h=Date:From:To:Subject:From; b=fdfH0mqloykFtoFhYXfoNO5ED1h+AjENKare/bn/GTz2MJlbRzxnJELZqdWftfSP9 N+YiGNF1Jd09ghyxgmk1ODqCf9/h95/sVLwSNYqTF/rcbq4DWxImQAxJkSICpu4AcC CdfH1JG7b7FZPtOAWbfggvjrdIF1UikUnU0VqIgY= Date: Thu, 13 Apr 2017 19:47:17 +0200 From: Antoine Amarilli To: zsh-workers@zsh.org Subject: Tab-completion problem through ssh when files start by dash (_remote_files:compadd:80: bad option: -@) Message-ID: <20170413174717.4w6iatxztyutpbps@mu.a3nm.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="be2g2vngfkuhndu6" Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) --be2g2vngfkuhndu6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello everyone, I would like to report what I think may be a bug in zsh. (I am not subscribed directly, so please include me in any replies.) The bug concerns tab-completion through ssh in directories containing a file that starts with a dash. The bug occurs when running zsh -f (using a fresh user on a Debian testing amd64 machine, if that matters -- I call the machine "foo"). To reproduce: 1. Enable autocomplete on machine foo by issuing: foo% autoload -Uz compinit foo% compinit 2. On a remote machine bar that can be reached by ssh with public-key authentication from foo, in the home directory of user jdoe, create a file whose name starts with a dash and occurs early in the alphabet, for instance "-@": =20 bar% cd ~jdoe bar% touch -- -@ 3. Try to scp a file "blah" from foo to bar and use tab-completion (indicated as ): foo% touch blah foo% scp blah jdoe@bar: When I do this, the result looks like this: foo% touch blah foo% scp blah jdoe@bar: _remote_files:compadd:80: bad option: -@ foo% scp test jdoe@bar: [ACTUAL CONTENTS OF ~jdoe ON bar] So it looks to me like the internals of tab-completion are not properly escaping the file names in this case, hence the warning. This is mostly an annoyance, but maybe there could be some more problematic implications (e.g., maybe a malicious jdoe on bar could create files that would pass actual options to compadd and mess up more seriously with the zsh session on foo). I hope that this report is useful! :) Best regards, --=20 Antoine Amarilli --be2g2vngfkuhndu6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEOcjWpfrki1T9GCYxgNiLItQzAzEFAljvuaUACgkQgNiLItQz AzH2VhAAiqKRqDVLPqiX78zJBYfjIlC1JmlsfaUnAmD9GpCQ1N4KKGZjorgbFdxe ZfUQbFVoD64mO7Jy8qXaaIsnebURo5PmZ4ohd6tcXRv0nBp0OKj6HNnzEnEZ01oa IddpfcxKY0SzfEbtPqBx6FNOtjiJmiKPGi41fbMcO8v/h9UabHYFW/IhhE4CUIqA njTaimRvbzPpIEhggEhdy7dpBlwUmZoNik77n9xaVaUz2a5H9EjlWBi79tHIhuQL neUDE2myHR7jXd6Skx98AA5zpW7Zq4mw0kEmst6wZ57aSqwN2E/HohT6CR3zwR9h uiWnA8Z726xEJF6TBMIObn5ejaOgElw8B0snqGFvqFOPOFHMTg1DYqWEpfM6A7OB xVZvhl3a2FEdL/wqz28FIUylJdj7BLDhV187yboBtSmLoMZc3iyEkBwhz8hdtQYt FbQdIEuQ02a2HwCk9sg5QGhDhL6SYjzSEMlS3cq7r03XbMYpm7Sd/VpHHOAOLUtu rVJZ8ue4o53ts74hywEx4/3gI2jnnxBfqS3n+qOHMD394XjZTwTYgXOynsgdAyvB 6El1LEL9TDVVGbRI6cALsRuKJCbR6pacN0o5eujh4AO8uMxlVNPflHx+RPRV6Sl2 m1MTiSYW00sBBSCJ0ouJkACB6QglJvLHiK0groEvlJe92VWzNeA= =vLJz -----END PGP SIGNATURE----- --be2g2vngfkuhndu6--