apport-retrace determines wrong package providing a file with uninstalled==True
Bug #1684117 reported by
Benjamin Drung
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apport |
Triaged
|
Undecided
|
Unassigned |
Bug Description
Assume that you have two packages foo1 and foo2 which provide the binary /usr/bin/foo.
make_sandbox() calls
pkg = apport.
In this example, report[path] would point to /usr/bin/foo. get_file_package() will return the first package name that it finds. So it might either return foo1 or foo2 which might be the wrong one. get_file_package() should take into account which package is installed instead.
description: | updated |
To post a comment you must log in.
Are you sure that this is the complete invocation? Can you please attach a standalone reproducer?
I see how that could happen if you pass uninstalled=True (it's False by default), as that will grep Contents.gz. But with uninstalled=False it consults dpkg diversions and /var/lib/ dpkg/info/ *.list, which should always deliver an unique result. So if two *installed* packages ship the same file without using diversions, that is not an apport bug.
The uninstalled=True case needs fixing for this, though. It should call self._search_ contents( ) only if the above did not already find the file, i. e move that bit to the end of the function.