Bug 72981

Summary: RFE: rpm -qf /path/to/symlink should follow symlink
Product: [Retired] Red Hat Linux Reporter: Ed Halley <ed>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
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: 2003-01-14 21:15:07 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 Ed Halley 2002-08-29 17:42:51 UTC
It would be helpful if the --query --file options would follow symlinks to offer
more information, especially if the symlink itself is not owned by an rpm.

For example, rpm currently gives:

   $ rpm -qf /etc/rc.d/rc2.d/S10network 
   file /etc/rc.d/rc2.d/S10network is not owned by any package

It would be helpful if rpm did the obvious legwork:

   $ rpm -qf /etc/rc.d/rc2.d/S10network
   file /etc/rc.d/rc2.d/S10network is not owned by any package
   file /etc/rc.d/rc2.d/S10network is a symlink to ../init.d/network
   initscripts-6.67-1

The symlink value may be retrieved with readlink(2).

In the case of symlinks which were owned, I think it should give the following
output.

   $ rpm -qf /path/to/symlink
   mysymlinks-1.0-1
   file /path/to/symlink is a symlink to ./realfile
   myrealfiles-1.0-1

Comment 1 Jeff Johnson 2003-01-14 21:15:07 UTC
I claim that rpm should manage packages, not the file system.

That means that rpm should not follow symlinks that are
not "owned" by packages.

Adding another line of output to "rpm -qf" output would
break various scripts.

There ain't no easy answer, and alternatives (e.g. /usr/bin/rpm)
implemented through symlinks just make the whole issue even more
complicated.

Basically, I don't think the additional functionality is worth the effort.