Bug 60288

Summary: rpm-4.0.4-7x.4 reports "No such file or directory" incorrectly with rpm -q -f
Product: [Fedora] Fedora Reporter: Jonathan Kamens <jik>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: twaugh
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: 2006-08-05 10:16:19 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 Jonathan Kamens 2002-02-24 13:08:19 UTC
jik:/usr/share/man/man3!126> ls -l  '/usr/share/man/man1/cancel.1.gz'
lrwxrwxrwx    1 root     root           33 Feb  6 08:45
/usr/share/man/man1/cancel.1.gz -> /etc/alternatives/print-cancelman
jik:/usr/share/man/man3!127> rpm -q -f '/usr/share/man/man1/cancel.1.gz'
error: file /usr/share/man/man1/cancel.1.gz: No such file or directory
jik:/usr/share/man/man3!128> 

Obviously, the file exists, because I just listed it with "ls -l", so rpm's
claim that it does not exist is bogus.  It's true that the link doesn't *point*
to anything, but I didn't ask rpm what it points to -- I asked rpm where the
link itself comes from.

Comment 1 Jeff Johnson 2002-02-24 16:08:52 UTC
This is a packaging, not an rpm, problem ATM, as
the symlink created by alternatives is not contained
in the package.

Comment 2 Jonathan Kamens 2002-02-24 18:59:33 UTC
No, it's an RPM problem, because what "rpm -q -f" is supposed to say if a file
isn't included in any package is, "File not included in any package", not "No
such file or directory".  I've seen it give the correct error (i.e., "File not
included in any package") in the past.


Comment 3 Tim Waugh 2002-02-26 08:48:06 UTC
Bill, how can this be done so that alternatives is happy?

Comment 4 Bill Nottingham 2002-02-26 15:40:54 UTC
That's the normal error for querying dangling symlinks that aren't included in
any package.

Comment 5 Tim Waugh 2002-03-04 09:52:33 UTC
Changing component to alternatives, since this affects all packages that use it.
(Or, I would if there was a bugzilla component for it..)

Comment 6 Bill Nottingham 2005-02-02 20:39:56 UTC
This is not an alternatives problem; if this is to be reopened, it
should be assigned to rpm for the behavior of 'rpm -qf' on a dangling
symlink.

Comment 7 Jonathan Kamens 2005-02-08 05:20:38 UTC
It is unpleasant to see Red Hat employees bickering about which
Red-Hat-maintained component is responsible for a problem that is
clearly a bug regardless of which component is at fault.  Rather than
bickering about which of you owns the bug, could you just sit down
together, figure out what the correct behavior should be, and derive
from that desired correct behavior which component needs to be
modified?  Sheesh.


Comment 8 Paul Nasrat 2005-09-29 18:12:06 UTC
Still exists in FC rpm - basically in query.c RPMQV_PATH handling access check
returns ENOENT and we check errno first.

Comment 9 Jeff Johnson 2006-08-05 10:16:19 UTC
Tim: re comment #2 and #5. Adding the alternative path as
      Provides: /usr/share/man/man1/cancel.1.gz
should display the package(s) that create the alternatives symlink. Hardly worth the effort imho.

Fixed (by using lstat rather than access) in rpm cvs, will be in rpm-4.4.7.