From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10247 invoked by alias); 19 Nov 2016 11:35:29 -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: 39983 Received: (qmail 2478 invoked from network); 19 Nov 2016 11:35:29 -0000 X-Qmail-Scanner-Diagnostics: from mondschein.lichtvoll.de 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(194.150.191.11):SA:0(-2.9/5.0):. Processed in 0.843213 secs); 19 Nov 2016 11:35:29 -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=-2.9 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: martin@lichtvoll.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at lichtvoll.de does not designate permitted sender hosts) From: Martin Steigerwald To: 844710@bugs.debian.org, Daniel Shahaf Cc: Martin Steigerwald , zsh-workers@zsh.org, Axel Beckert Subject: Re: Bug#844710: Fwd: Re: [Pkg-zsh-devel] Bug#844710: autocorrection suggested rm for typing mr without typing "y" Date: Sat, 19 Nov 2016 12:27:12 +0100 Message-ID: <7714408.9UiMmvpNuW@merkaba> User-Agent: KMail/5.2.3 (Linux/4.8.0-1-amd64; KDE/5.27.0; x86_64; ; ) In-Reply-To: <20161119075542.GA6750@fujitsu.shahaf.local2> References: <3574167.p9ErITdPmY@merkaba> <20161119075542.GA6750@fujitsu.shahaf.local2> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Am Samstag, 19. November 2016, 07:55:42 CET schrieb Daniel Shahaf: > Martin Steigerwald wrote on Fri, Nov 18, 2016 at 14:15:51 +0100: > > So two fixes to consider: > >=20 > > 1) Don=C2=B4t confirm on space, as thats to easy to trigger accidentall= y. :) >=20 > The code confirms on both tabs (since commit 7f1ce570) and spaces (since > before CVS). Does anyone know a reason for doing this? >=20 > The patch also downscopes a couple of local variables, with no > functional change. [=E2=80=A6] > On a tangent: what do "nyae" mean? I couldn't find the answer in the > manual. I thought about this as well. > > 2) Don=C2=B4t autocorrect to dangerous commands like "rm". Could be a b= it > > challenging to make a list of commands which are dangerous and can easi= ly > > trigger unwanted actions. "rm" would IMO definately be one of this, whi= le > > with "dd" it would be harder to trigger an unwanted action by accident > > due to syntax requirements. > >=20 > > Axel made me aware that I tell Z-Shell to ignore dangerous commands with > > CORRECT_IGNORE=3Drm, but I think it would be good to reconsider the sta= ndard > > behavior. >=20 > Well, it _does_ prompt the user asking whether "rm" is correct. Isn't > that sufficient? Well, I meant the last sentence "I think it would be good to reconsider the= =20 standard behavior" generally to both of the above items. The current=20 combination of 1) and 2) invites accepting dangerous autocorrections=20 accidentally. It may be enough to change 1) or 2).=20 That written, on other occassions Z-Shell protects the user from accidental= ly=20 triggering potentially dangerous operations as well: Z-Shell: martin@merkaba:/tmp/test/test2> echo LANG=3DC rm -rf .* LANG=3DC rm -rf .* martin@merkaba:/tmp/test/test2> LANG=3DC rm -rf .* Bash: martin@merkaba:/tmp/test/test2> bash martin@merkaba:/tmp/test/test2 -> echo LANG=3DC rm -rf .* LANG=3DC rm -rf . .. martin@merkaba:/tmp/test/test2 -> LANG=3DC rm -rf .* rm: refusing to remove '.' or '..' directory: skipping '.' rm: refusing to remove '.' or '..' directory: skipping '..' (Actually I am glad that coreutils rm -rf skips these meanwhile too. And al= so=20 refused to do rm -rf / unless a special option is given.) Thank you, =2D-=20 Martin