* [Bug Report] Erroneous path resolution for `rm /*`
@ 2021-09-01 21:32 Le, Vinh-Kha
2021-09-01 22:09 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Le, Vinh-Kha @ 2021-09-01 21:32 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 811 bytes --]
Hello all,
I am writing this email to report a bug in Zsh 5.8 that I could not find documented anywhere online. There is a feature that prompts the user for confirmation when invoking `rm` with a glob argument. The message usually reads:
```zsh
zsh: sure you want to delete all $n files in $dir [yn]?
```
Running `rm /*` triggers a prompt for the pattern `*` at the current directory rather than at root. This is misleading and could prove disastrous.
Steps to reproduce:
1. Ideally, run in a VM.
2. Make sure you have `unsetopt RM_STAR_SILENT`.
3. Run `rm /*` from a non-root directory.
Expected prompt:
```zsh
zsh: sure you want to delete all $n files in / [yn]?
```
Actual prompt:
```zsh
zsh: sure you want to delete all $n files in $(pwd) [yn]?
```
Best,
Vinh-Kha
[-- Attachment #2: Type: text/html, Size: 5257 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug Report] Erroneous path resolution for `rm /*`
2021-09-01 21:32 [Bug Report] Erroneous path resolution for `rm /*` Le, Vinh-Kha
@ 2021-09-01 22:09 ` Bart Schaefer
2021-09-01 22:12 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2021-09-01 22:09 UTC (permalink / raw)
To: Le, Vinh-Kha; +Cc: zsh-workers
On Wed, Sep 1, 2021 at 2:33 PM Le, Vinh-Kha <lvinhkh@amazon.com> wrote:
>
> Running `rm /*` triggers a prompt for the pattern `*` at the current directory rather than at root. This is misleading and could prove disastrous.
I am almost certain I've seen this reported before, but no fix was
ever committed.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug Report] Erroneous path resolution for `rm /*`
2021-09-01 22:09 ` Bart Schaefer
@ 2021-09-01 22:12 ` Bart Schaefer
2021-09-06 17:42 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2021-09-01 22:12 UTC (permalink / raw)
To: Le, Vinh-Kha; +Cc: zsh-workers
On Wed, Sep 1, 2021 at 3:09 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Wed, Sep 1, 2021 at 2:33 PM Le, Vinh-Kha <lvinhkh@amazon.com> wrote:
> >
> > Running `rm /*` triggers a prompt for the pattern `*` at the current directory rather than at root. This is misleading and could prove disastrous.
>
> I am almost certain I've seen this reported before, but no fix was
> ever committed.
Yep, thread starting with workers/46169 in January 2020, but none of
the (several? I didn't try to re-parse the whole thread) patches got
applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug Report] Erroneous path resolution for `rm /*`
2021-09-01 22:12 ` Bart Schaefer
@ 2021-09-06 17:42 ` Bart Schaefer
2021-09-06 17:50 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2021-09-06 17:42 UTC (permalink / raw)
To: Le, Vinh-Kha; +Cc: zsh-workers
On Wed, Sep 1, 2021 at 3:12 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> Yep, thread starting with workers/46169 in January 2020, but none of
> the (several? I didn't try to re-parse the whole thread) patches got
> applied.
It looks like workers/46175 is the complete patch for this, in three parts.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Bug Report] Erroneous path resolution for `rm /*`
2021-09-06 17:42 ` Bart Schaefer
@ 2021-09-06 17:50 ` Bart Schaefer
0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2021-09-06 17:50 UTC (permalink / raw)
To: Le, Vinh-Kha; +Cc: zsh-workers
On Mon, Sep 6, 2021 at 10:42 AM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Wed, Sep 1, 2021 at 3:12 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
> >
> > Yep, thread starting with workers/46169 in January 2020, but none of
> > the (several? I didn't try to re-parse the whole thread) patches got
> > applied.
>
> It looks like workers/46175 is the complete patch for this, in three parts.
... and upon closer examination, it HAS been applied. Sorry I missed it before.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-09-06 17:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 21:32 [Bug Report] Erroneous path resolution for `rm /*` Le, Vinh-Kha
2021-09-01 22:09 ` Bart Schaefer
2021-09-01 22:12 ` Bart Schaefer
2021-09-06 17:42 ` Bart Schaefer
2021-09-06 17:50 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).