Debian Bug report logs - #134758
'dpkg -S' and symlinks

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

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.10.10, 1.10.27, 1.13.25., 1.9.19

Reply or subscribe to this bug.

Toggle useless messages

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 and rfc822 format available.

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 and rfc822 format available.

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

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 and rfc822 format available.

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 and rfc822 format available.

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

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 and rfc822 format available.

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 and rfc822 format available.

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 and rfc822 format available.

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 and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 07:23:21 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.