zsh-workers
 help / color / mirror / code / Atom feed
From: "Le, Vinh-Kha" <lvinhkh@amazon.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: [Bug Report] Erroneous path resolution for `rm /*`
Date: Wed, 1 Sep 2021 21:32:56 +0000	[thread overview]
Message-ID: <7de6834ef6d245ddb7d3cc881ff5902c@EX13D27UWB004.ant.amazon.com> (raw)

[-- 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 --]

             reply	other threads:[~2021-09-01 21:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01 21:32 Le, Vinh-Kha [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7de6834ef6d245ddb7d3cc881ff5902c@EX13D27UWB004.ant.amazon.com \
    --to=lvinhkh@amazon.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).