Bug 121993
Summary: | rpm cannot handle filenames with square brackets in them | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Ken Snider <ksnider> |
Component: | rpm | Assignee: | Jeff Johnson <jbj> |
Status: | CLOSED WONTFIX | QA Contact: | Mike McLean <mikem> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | msw |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-05-04 16:19:29 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Ken Snider
2004-04-29 16:28:14 UTC
This isn't a bug in RPM. bash is seeing the existence of the file and doing globbing on the command line before passing the args to rpm. *Really now*.. [root@<host> ksnider]# echo 'libusb-0[1].1.6-3.i386.rpm' libusb-0[1].1.6-3.i386.rpm [root@<host> ksnider]# less 'libusb-0[1].1.6-3.i386.rpm' "libusb-0[1].1.6-3.i386.rpm" may be a binary file. See it anyway? [root@<host> ksnider]# grep usb 'libusb-0[1].1.6-3.i386.rpm' Binary file libusb-0[1].1.6-3.i386.rpm matches [root@<host> ksnider]# ls -l 'libusb-0[1].1.6-3.i386.rpm' -rw-r--r-- 1 root root 11382 Apr 29 15:48 libusb-0[1].1.6-3.i386.rpm Amazing how every other program can *perfectly interpret* what is being passed to it as an argument, hm? See, bash has this neat little feature called "Shell Grammar". This grammar allows you to modify the arguments given to a file such that the arguments aren't otherwise manipulated by the shell. The Oreilly bash book can probably explain this is more detail, but I'll do you the favour of including an excerpt from the man page: "Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash." In other words, no. The shell is *not* seeing the existence of anything and doing anything to it. That was the purpose of the single quotes surrounding the text - to remove any expansion performed by the shell. No, I'm afraid this really is a bug in RPM. Sorry. Putting square brackets in file names is asking for trouble. Have fun! *sigh* You understand that this behavior is both part of the POSIX specification, and REQUIRED for LSB compliance, yes? Specifically Chapter 23 of LSB 1.3 indicates that "Utilities that perform filename globbing (also known as Pattern Matching Notation) shall do it as specified in the Single UNIX Specification". Section 2.13 of said Specification (Pattern Matching Notation) indicates that a single bracket character should only be treated as a special character if unescaped. This is an LSB-compliance-affecting BUG in RPM. More importantly, as I've shown, RPM's behaviour is INCONSISTENT with other system utilities which *do* follow POSIX/LSB specifications in handling files of this type. Yup. |