symlink loop detected in path 'usr/share/doc/module-init-tools/changelog.Debian.gz'

Bug #1792934 reported by Marius Gedminas
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
debsums (Ubuntu)
Confirmed
Undecided
Unassigned
kmod (Ubuntu)
New
Undecided
Unassigned
module-init-tools (Ubuntu)
New
Undecided
Unassigned

Bug Description

I ran debsums -ac and it printed this error

    debsums: Error: symlink loop detected in path 'usr/share/doc/module-init-tools/changelog.Debian.gz'. Please file a bug again module-init-tools.

So here I am, filing a bug against module-init-tools.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: module-init-tools 24-1ubuntu3
ProcVersionSignature: Ubuntu 4.15.0-34.37-generic 4.15.18
Uname: Linux 4.15.0-34-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.3
Architecture: amd64
Date: Mon Sep 17 16:13:36 2018
InstallationDate: Installed on 2012-11-02 (2144 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
PackageArchitecture: all
ProcEnviron:
 LC_CTYPE=lt_LT.UTF-8
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: kmod
UpgradeStatus: Upgraded to bionic on 2018-09-16 (1 days ago)

Revision history for this message
Marius Gedminas (mgedmin) wrote :
Revision history for this message
Marius Gedminas (mgedmin) wrote :

(TBH I've no idea what debsums is nattering about, /usr/share/doc/module-init-tools/changelog.Debian.gz is a regular file, and no parent directory is a symlink.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kmod (Ubuntu):
status: New → Confirmed
Revision history for this message
Pas (pasthelod) wrote :

strace -f debsums module-init-tools:

lstat("/usr/share/doc/module-init-tools", {st_mode=S_IFLNK|0777, st_size=23, ...}) = 0
readlink("/usr/share/doc/module-init-tools", "/usr/share/doc/libkmod2", 4095) = 23
write(2, "debsums: Error: symlink loop det"..., 146debsums: Error: symlink loop detected in path 'usr/share/doc/module-init-tools/changelog.Debian.gz'. Please file a bug against module-init-tools.

So it seems this is a bug in debsums, probably it assumes that there are no symlinked files in the relevant md5sums files.

/var/lib/dpkg/info/module-init-tools.md5sums file is just one line:

c629c0d493d1b6559648de3f63d398d9 usr/share/doc/module-init-tools/changelog.Debian.gz

But /usr/share/doc/module-init-tools is a symlink. And module-init-tools (24-1ubuntu3.2) itself is a pretty empty package, it just has that one file anyhow, and nothing depends on it, it can be removed. (It's only available in bionic anyway.)

Revision history for this message
Ilya (iva2k) wrote :

It is debsums bug. Uninstalling module-init-tools lets debsums pass first error, but it throws same error on another package:

```
debsums: Error: symlink loop detected in path 'usr/share/doc/openoffice.org-calc/changelog.Debian.gz'. Please file a bug again openoffice.org-calc.
```

Revision history for this message
Ilya (iva2k) wrote :

Not a problem with mentioned package, but with the tool "debsums"

affects: kmod (Ubuntu) → debsums (Ubuntu)
Revision history for this message
Ilya (iva2k) wrote :

I inspected perl code in /usr/bin/debsums...

The logic around catchink symlink loop is a bit flawed. Its in a function resolve_path() and it is only called from method .check() which intends to verify if the file can be opened. Since its goal is to find any bad files, symlink loop should be reported as any other file open errors, and the tool should not die, even if there is a legitimate symlink loop.

So I changed perl code - instead of 'die ...' -> 'return "";', and after 'my $resolved = resolve_path(...) added an if block:

         my $resolved = resolve_path($path,$pack);
+ if ($resolved eq "") {
+ warn "$self: symlink loop - can't open $pack file $root/$path ($@)\n";
+ return 2;
+ }

With that change debsums does not fail on the symlink loops and reports them with all other problem files.

BTW:
openoffice.org-calc package did not have symlink loop, but it linked to a file from uno-libs3 package, which did have a loop, reinstalling uno-libs3 package fixed/removed the loop.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.