这是indexloc提供的服务,不要输入任何密码

Debian Bug report logs - #134758
dpkg-query: Make -S handle unowned symlinks resolving to owned pathnames

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg (PTS, buildd, popcon).

Reported by: Richard Kettlewell <rjk@greenend.org.uk>

Date: Tue, 19 Feb 2002 22:33:03 UTC

Severity: wishlist

Merged with 198220, 433290

Found in versions 1.9.19, dpkg/1.18.23, 1.13.25., dpkg/1.14.25, dpkg/1.10.27, 1.10.10

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org:
Bug#134758; Package dpkg. (full text, mbox, link).


Acknowledgement sent to Richard Kettlewell <rjk@greenend.org.uk>:
New Bug report received and forwarded. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>, dpkg@packages.qa.debian.org. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Richard Kettlewell <rjk@greenend.org.uk>
To: submit@bugs.debian.org
Subject: 'dpkg -S' and symlinks
Date: Tue, 19 Feb 2002 22:23:20 +0000 (GMT)
Package: dpkg
Version: 1.9.19
Severity: wishlist

dpkg -S only compares filenames lexically: so symlinks can lead to
annoying false negatives, as in the following example:

    lyonesse$ type xterm
    xterm is /usr/bin/X11/xterm
    lyonesse$ dpkg -S /usr/bin/X11/xterm
    dpkg: /usr/bin/X11/xterm not found.
    lyonesse$ realpath /usr/bin/X11/xterm
    /usr/X11R6/bin/xterm
    lyonesse$ dpkg -S /usr/X11R6/bin/xterm
    xterm: /usr/X11R6/bin/xterm

However, realpathing the search term doesn't solve the problem:
consider the case where the operator has replaced some standard
directory such as /usr/sbin with a symlink (e.g. to split up /usr over
several partitions due to space constraints, or to identify /usr/sbin
with /usr/bin).  Then realpathing the search term would result in
*nothing* in /usr/sbin matching, which is even worse than the current
behaviour.

realpathing filenames as they are written to PACKAGE.list at
install time would solve this, but would break the ability of the
operator to move bits of filesystem around leaving links behind to
keep the standard names working without telling dpkg about it, which
is surely an unreasonable imposition.

realpathing them as they are read from PACKAGE.list in the process of
implementing -S would work better, but dpkg -S is far too slow
already.  Even with caching, this would amount to 100,000 or more
lstat() calls on a reasonably package-heavy system.

Anyone got any better ideas?

A solution to the exact example quoted above would be to insist that
PATH entries be the same as the path found in debfiles, (so
e.g. /etc/profile would have /usr/X11R6/bin where it now has
/usr/bin/X11).  However this is not a general solution.

ttfn/rjk



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Development <debian-dpkg@lists.debian.org>:
Bug#134758; Package dpkg. (full text, mbox, link).


Acknowledgement sent to Rolf Leggewie <debian-bugs@rolf.leggewie.biz>:
Extra info received and forwarded to list. Copy sent to Dpkg Development <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #10 received at 134758@bugs.debian.org (full text, mbox, reply):

From: Rolf Leggewie <debian-bugs@rolf.leggewie.biz>
To: Debian Bug Tracking System <134758@bugs.debian.org>
Subject: /usr/bin/dpkg: #134758: 'dpkg -S' and symlinks
Date: Fri, 29 Apr 2005 12:54:53 +0200
Package: dpkg
Version: 1.10.27
Followup-For: Bug #134758

Hi,

I do not know much about realpath, I have never used it previously.  
I assume that using which instead of realpath would not solve the 
speed problem, would it?

Regards

Rolf

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.26.desktop041204
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)

Versions of packages dpkg depends on:
ii  dselect                     1.10.27      a user tool to manage Debian packa
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information



Merged 134758 198220. Request was from Buildd user <meitner@lichtenheld.de> to control@bugs.debian.org. (full text, mbox, link).


Forcibly Merged 134758 198220 433290. Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Mon, 16 Jul 2007 09:45:03 GMT) (full text, mbox, link).


Tags added: patch Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Wed, 18 Jul 2007 00:24:03 GMT) (full text, mbox, link).


Removed tag(s) patch. Request was from Raphaël Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Thu, 06 May 2010 13:33:14 GMT) (full text, mbox, link).


Severity set to 'important' from 'wishlist' Request was from Raphaël Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Mon, 12 Dec 2016 11:57:07 GMT) (full text, mbox, link).


Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#134758; Package dpkg. (Mon, 12 Dec 2016 12:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Mon, 12 Dec 2016 12:57:03 GMT) (full text, mbox, link).


Message #25 received at 134758@bugs.debian.org (full text, mbox, reply):

From: Raphael Hertzog <hertzog@debian.org>
To: 134758@bugs.debian.org
Cc: Helmut Grohne <helmut@subdivi.de>
Subject: dpkg -S and symlinks
Date: Mon, 12 Dec 2016 13:53:25 +0100
Hi,

Now that some users enabled "usrmerge" it has become more important
that "dpkg -S" deals sensibly with symlinks. I have thus raised the
severity of this bug to important (following the discussion
with Helmut in #843073).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/



Added indication that bug 134758 blocks 848622 Request was from md@Linux.IT (Marco d'Itri) to 848622-submit@bugs.debian.org. (Mon, 19 Dec 2016 14:33:06 GMT) (full text, mbox, link).


Marked as found in versions dpkg/1.18.23, dpkg/1.14.25, and dpkg/1.10.27; no longer marked as found in versions 1.10.27. Request was from Sven Joachim <svenjoac@gmx.de> to 858331-submit@bugs.debian.org. (Tue, 21 Mar 2017 16:15:08 GMT) (full text, mbox, link).


Merged 134758 198220 433290 858331 Request was from Sven Joachim <svenjoac@gmx.de> to 858331-submit@bugs.debian.org. (Tue, 21 Mar 2017 16:15:13 GMT) (full text, mbox, link).


Disconnected #858331 from all other report(s). Request was from Guillem Jover <guillem@debian.org> to 858331-submit@bugs.debian.org. (Sat, 25 Mar 2017 14:45:07 GMT) (full text, mbox, link).


Added indication that bug 134758 blocks 839046,839162 Request was from Laurent Bigonville <bigon@debian.org> to control@bugs.debian.org. (Mon, 07 May 2018 09:36:05 GMT) (full text, mbox, link).


Changed Bug title to 'dpkg-query: Make -S handle unowned symlinks resolving to owned pathnames' from ''dpkg -S' and symlinks'. Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Mon, 04 Mar 2019 21:45:09 GMT) (full text, mbox, link).


Severity set to 'wishlist' from 'important' Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Mon, 04 Mar 2019 23:03:10 GMT) (full text, mbox, link).


Removed indication that bug 134758 blocks 848622 Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Fri, 12 Nov 2021 04:00:03 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 26 21:26:38 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.