umount bash completion explodes awk on some paths

Control: found -1 2.38.1-5+b1
Control: tags -1 + fixed-upstream - help

On Sun, Sep 04, 2022 at 12:07:35PM +0200, Andreas Henriksson wrote:
> Thanks for narrowing this down. Could you please submit your findings
> to the upstream mailing list? (util-linux at vger.kernel.org)
You removed me from CC so I didn't get your mail
(submitters don't get bug mail forwarded by default);
re-discovered this report after I got
  nabijaczleweli@tarta:~/uwu/SunOS 2.0 (Tape) [Sun-2]/tape1$ sudo umount 0awk: 
cmd. line:8: (FILENAME=- FNR=1) fatal: invalid regexp: Invalid range end: 
/^/home/nabijaczleweli/uwu/SunOS 2.0 (Tape) [Sun-2]/tape1/
  awk: cmd. line:8: (FILENAME=- FNR=1) fatal: invalid regexp: Invalid range 
end: /^/home/nabijaczleweli/uwu/SunOS 2.0 (Tape) [Sun-2]/tape1/
  awk: cmd. line:8: (FILENAME=- FNR=1) fatal: invalid regexp: Invalid range 
end: /^/home/nabijaczleweli/uwu/SunOS 2.0 (Tape) [Sun-2]/tape1/
(yes, same path; same archive) today on bookworm.

I tested the util-linux 2.39 tarball to prepare a patch:
the completion has changed, and now escapes the path before using it as
a regex; I've validated that
  $ (cd ~/uwu/SunOS\ 2.0\ \(Tape\)\ \[Sun-2]/tape1; _umount_points_list)
  awk: cmd. line:8: (FILENAME=- FNR=1) fatal: invalid regexp: Invalid range 
end: /^/home/nabijaczleweli/uwu/SunOS 2.0 (Tape) [Sun-2]/tape1/
  $ . /usr/share/bash-completion/completions/umount
  $ (cd ~/uwu/SunOS\ 2.0\ \(Tape\)\ \[Sun-2]/tape1; _umount_points_list)
  awk: cmd. line:8: (FILENAME=- FNR=1) fatal: invalid regexp: Invalid range 
end: /^/home/nabijaczleweli/uwu/SunOS 2.0 (Tape) [Sun-2]/tape1/
  $ . ./bash-completion/umount
  $ (cd ~/uwu/SunOS\ 2.0\ \(Tape\)\ \[Sun-2]/tape1; _umount_points_list)
  /home/nabijaczleweli
  /proc
  # ...
  /home/nabijaczleweli
  ~/uwu/SunOS\ 2.0\ \(Tape\)\ \[Sun-2\]/tape1/04.d
  ./04.d
  04.d
  /home/nabijaczleweli/uwu/SunOS\ 2.0\ \(Tape\)\ \[Sun-2\]/tape1/04.d

Re-tagging appropriately.

Best,
наб

Attachment:
signature.asc

Description: PGP signature

Read more here: Source link