Bug 101731 - rpm doesn't like glob wildcards in filenames
rpm doesn't like glob wildcards in filenames
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: rpm (Show other bugs)
2.1
All Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-08-06 07:17 EDT by Bastien Nocera
Modified: 2007-11-30 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-08-21 11:30:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bastien Nocera 2003-08-06 07:17:39 EDT
rpm doesn't print any errors but fails to install packages with square braces in
the filename.

On a RHL 7.2, and RHEL 2.1:
# ls kernel-*
kernel-summit-2.4.9-e.16.[scb].i686.rpm
# rpm -ivh kernel-*
#

On RHL 9 (still broken but it prints an error at least)
# ls kernel*
kernel-summit-2.4.9-e.16.[scb].i686.rpm
rpm -ivh kernel*
error: File not found by glob: kernel-summit-2.4.9-e.16.[scb].i686.rpm
Comment 1 Mike McLean 2003-08-06 11:29:18 EDT
You can run into similar problems with any glob wildcard pattern (*, ?, [...])
placed literally in a filename.  Shouldn't rpm try the filename literally first
before falling back to globbing?

Also, it doesn't always give a warning.

.live.[root@i386-9 root]# rpm -qp kernel-2.4.20-8.i686.rpm
kernel-2.4.20-8
.live.[root@i386-9 root]# cp kernel-2.4.20-8.i686.rpm kernel-\[xyz\].i686.rpm
.live.[root@i386-9 root]# ls kernel-\[xyz\].i686.rpm
kernel-[xyz].i686.rpm
.live.[root@i386-9 root]# rpm -qp kernel-\[xyz\].i686.rpm
.live.[root@i386-9 root]#

Comment 2 Jeff Johnson 2003-08-21 11:30:10 EDT
Yes, rpm CLI behavior has changed, warning message printed now.

Yes, there is no rpm update for legacy platforms, particularly for AS 2.1.

Yes, adding glob characters to file names requires escaping, and can
often be confusing, rpm is no different than many other programs in
this respect.

So what's the problem? Reopen with additional info please.
Comment 3 Munzir Taha 2004-06-03 21:23:43 EDT
No, it's different. I agree this is a bug.  
Suppose you have a file acroread-5[1].0.8-2mdk.i586.rpm  
cp acroread-5\[1\].0.8-2mdk.i586.rpm mydir  
works  
cp acroread-5[1].0.8-2mdk.i586.rpm mydir  
also works but  
# rpm -ivh acroread-5\[1\].0.8-2mdk.i586.rpm  
error: File not found by glob: acroread-5[1].0.8-2mdk.i586.rpm  
AND  
# rpm -ivh acroread-5[1].0.8-2mdk.i586.rpm  
error: File not found by glob: acroread-5[1].0.8-2mdk.i586.rpm  
  
even  
# rpm -ivh acrore*  
error: File not found by glob: acroread-5[1].0.8-2mdk.i586.rpm  
  
So how should I install such a package then?!  
 
Please open this bug again. 
Comment 4 Muhammad Alkarouri 2004-06-04 07:00:10 EDT
> Yes, adding glob characters to file names requires escaping, and can
> often be confusing, rpm is no different than many other programs in
> this respect.

Except that no obvious escaping works in this case:

[karouri@dyn054077 sw]$ rpm -ivh 'ZSI-1.5.0-[k].noarch.rpm'
error: File not found by glob: ZSI-1.5.0-[k].noarch.rpm
[karouri@dyn054077 sw]$ rpm -ivh ZSI-1.5.0-[k].noarch.rpm
error: File not found by glob: ZSI-1.5.0-[k].noarch.rpm
[karouri@dyn054077 sw]$ rpm -ivh ZSI-1.5.0-\[k].noarch.rpm
error: File not found by glob: ZSI-1.5.0-[k].noarch.rpm
[karouri@dyn054077 sw]$ rpm -ivh ZSI-1.5.0-\[k\].noarch.rpm
error: File not found by glob: ZSI-1.5.0-[k].noarch.rpm
[karouri@dyn054077 sw]$ rpm -ivh ZSI-1.5.0-\\[k\\].noarch.rpm
error: File not found by glob: ZSI-1.5.0-\[k\].noarch.rpm

No '' enclosing, no [],\[],\[\],\\[\\], etc.

This was actually tested in Fedora Core 1, rpm version 4.2.1

Note You need to log in before you can comment on or make changes to this bug.