zsh-workers
 help / color / mirror / code / 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

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).