Bug 14961 - RPM -qf requires full path
Summary: RPM -qf requires full path
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-01 14:00 UTC by Cole Tuininga
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-09-14 17:19:12 UTC
Embargoed:


Attachments (Terms of Use)
don't remove leading ./ in rpmCleanPath (743 bytes, patch)
2000-08-05 20:37 UTC, Jeremy Katz
no flags Details | Diff

Description Cole Tuininga 2000-08-01 14:00:03 UTC
Performing an rpm -qf on a file will not work with relative paths:

[root@(removed) etc]# rpm -qf ./rc.d/init.d/lpd
file /rc.d/init.d/lpd: No such file or directory
[root@(removed) etc]# cd rc.d/init.d
[root@(removed) init.d]# rpm -qf ./lpd
file /lpd: No such file or directory
[root@(removed) init.d]# rpm -qf `pwd`/lpd
LPRng-3.6.21-8

Comment 1 Jeremy Katz 2000-08-05 20:36:42 UTC
This is because rpmCleanPath is, in my opinion, a little overzealous about
stripping the path to files.  The attached patch will solve this problem, but
I'm not sure what other problems are caused by leaving a leading ./ on the files
opened by rpm.

Comment 2 Jeremy Katz 2000-08-05 20:37:49 UTC
Created attachment 2117 [details]
don't remove leading ./ in rpmCleanPath

Comment 3 Jeff Johnson 2000-08-06 23:25:51 UTC
There are almost certainly "other problems". Deferred.

Comment 4 Jeff Johnson 2000-09-16 14:04:57 UTC
Time to find out what other problems there are. Applied in rpm-4.1 cvs, thanks
for the patchl.


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