Bug 60288 - rpm-4.0.4-7x.4 reports "No such file or directory" incorrectly with rpm -q -f
Summary: rpm-4.0.4-7x.4 reports "No such file or directory" incorrectly with rpm -q -f
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm   
(Show other bugs)
Version: rawhide
Hardware: i386 Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
Depends On:
TreeView+ depends on / blocked
Reported: 2002-02-24 13:08 UTC by Jonathan Kamens
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-05 10:16:19 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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

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

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.

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