[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DEP 17: Improve support for directory aliasing in dpkg



Hi,

On 30.04.23 03:08, Marvin Renich wrote:

My understanding from following this thread (and others) is that dpkg
has a bug that can easily be triggered by a sysadmin replacing a
directory with a symlink (and some other necessary conditions that don't
happen very often), which is explicitly allowed by policy.

No, it becomes "easily" triggered because usrmerge aims to move the files in the packages, which would cause /bin to become empty at some point in the future, at which point dpkg correctly needs to remove it.

As long as /bin/ls exists in coreutils, the /bin -> usr/bin symlink will be safe from deletion.

The --add-alias solution that has been suggested in this thread seems
like it would fix the general problem iff policy was changed to require
sysadmins to use it if they replaced a directory with a symlink.

Yes, we want something that is basically --add-alias that returns us to a state where dpkg's model is an accurate representation of reality.

I do not understand why the dpkg maintainer has rejected this solution;

I've understood this to be mostly an issue with the quality of the patches submitted, not the general idea. Dpkg has a really extensive test suite, I have not so far seen any patch being submitted that even adds test cases there. My branch adds six, that is still ridiculously low.

it would still be a fix for the general bug after the usrmerge
transition has completed.  And it would be at least one order of
magnitude more performant than scanning the filesystem for directory
symlinks.

That, and as far as I can see, fixing the general problem will also be a prerequisite to finishing the transition in the first place because there are lots of subtle little things caused by the model mismatch, and the workarounds solve the problem at hand but further entrench the mismatch.

   Simon

PS: Current state of my branch:

Selecting previously unselected package pkg-usrmerge.
(Reading database ... 6 files and directories currently installed.)
Preparing to unpack pkg-usrmerge.deb ...
D000001: process_archive oldversionstatus=not installed
/home/geier/dpkg/tests/t-file-conflicts-usrmerge/../dpkgdb/tmp.ci/preinst install
D000001: ensure_canonical: new, (re)loading
D000001: ensure_canonical: found mapping /bin -> /usr/bin
D000001: ensure_canonical: mapping /bin -> /usr/bin seems to be new
D000001: create_alias: alias /bin/test-conflict -> /usr/bin/test-conflict conflicts with pkg-b(0)

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: