zsh-workers
 help / color / mirror / Atom feed
* [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

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ https://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git