Control: tags -1 + confirmed
Control: clone -1 -2
Control: reassign -2 systemd-sysv
Control: found -2 255-rc2-1
Control: retitle -2 duplicated diversions are still broken by moved files

On Sun, Nov 19, 2023 at 02:08:35PM -0800, Francois Marier wrote:
> I'm also a little confused by the diverts. Perhaps something changed in
> systemd (which owns the ultimate underlying symlinks)?

I was sure I had this properly tested and yet it doesn't work as
expected. I'm sorry for having gotten this wrong.

Reproducer:

mmdebstrap bookworm /dev/null http://deb.debian.org/debian 
--include=systemd-sysv,molly-guard --customize-hook='sed -i -e s/bookworm/sid/ 
$1/etc/apt/sources.list' --chrooted-customize-hook='apt-get update' 
--chrooted-customize-hook='apt-get -y install systemd-sysv' 
--customize-hook='ls -l $1/lib/molly-guard/'

Different reproducer:

mmdebstrap trixie /dev/null http://deb.debian.org/debian 
--include=systemd-sysv,molly-guard --customize-hook='sed -i -e s/trixie/sid/ 
$1/etc/apt/sources.list' --chrooted-customize-hook='apt-get update' 
--customize-hook='test -e $1/lib/molly-guard/reboot' 
--chrooted-customize-hook='apt-get -y install systemd-sysv' 
--customize-hook='ls -l $1/lib/molly-guard/'

Specifically, the files vanish on upgrading systemd-sysv such that
/sbin/reboot moves to /usr/sbin/reboot. I should have seen this failure
in earlier tests.

I've dug into dpkg and usually when it moves a file from / to /usr,
it'll first unpack the new file (unknowingly replacing the existing old
one) and then removes the old one (via pkg_remove_old_files). During
that removal, it has a check to see whether the file to be removed
happens to match one of the files it just installed and skips the
removal in that case. For some reason, this safety check does not work
when the file is diverted.

So I have a vague understanding of what is wrong here, but no solution
yet. For the time being, I duplicate this into a blocker bug for
systemd-sysv to prevent it from migrating to testing until we figure out
a solution.

Sorry for the inconvenience.

Helmut

Reply via email to