Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1020277: 20copyfiles: cp: not writing through dangling symlink

143 views
Skip to first unread message

Arnaud Rebillout

unread,
Sep 19, 2022, 4:20:03 AM9/19/22
to
Package: schroot
Version: 1.6.13-2
Severity: normal
User: de...@kali.org
Usertags: origin-kali

Dear Maintainer,

in a chroot I need to install systemd-resolved. systemd-resolved creates
a symlink etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf,
which is a dangling symlink.

Consequently, schroot fails to start the chroot:

E: 20copyfiles: cp: not writing through dangling symlink '<<CHROOT>>/etc/resolv.conf'
E: <<CHROOT>>: Chroot setup failed: stage=setup-start

To reproduce:

~~~~
# debootstrap sid sid-resolved

# cat << EOF > /etc/schroot/chroot.d/sid-resolved
[sid-resolved]
type=directory
directory=$(pwd)/sid-resolved
profile=default
groups=root,sbuild
root-groups=root,sbuild
EOF

# schroot -c sid-resolved -- sh -c "apt-get update && apt-get install -y systemd-resolved"

# schroot -c sid-resolved
E: 20copyfiles: cp: not writing through dangling symlink '/var/run/schroot/mount/sid-resolved-2b844c78-1704-45e6-a260-6e8271ea2f2d/etc/resolv.conf'
E: sid-resolved-2b844c78-1704-45e6-a260-6e8271ea2f2d: Chroot setup failed: stage=setup-start

# ls -l sid-resolved/etc/resolv.conf
lrwxrwxrwx 1 root root 39 Sep 19 14:40 sid-resolved/etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
~~~~

We can force cp to copy the file anyway by using the option
--remove-destination. Cf. merge request at:
https://codeberg.org/shelter/reschroot/pulls/4

Regards,

Arnaud

-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.19.0-1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages schroot depends on:
ii debconf [debconf-2.0] 1.5.79
ii libboost-filesystem1.74.0 1.74.0-17
ii libboost-iostreams1.74.0 1.74.0-17
ii libboost-program-options1.74.0 1.74.0-17
ii libc6 2.34-7
ii libgcc-s1 12.2.0-2
ii libpam0g 1.5.2-2
ii libstdc++6 12.2.0-2
ii libuuid1 2.38.1-1
ii schroot-common 1.6.13-2
ii sysvinit-utils [lsb-base] 3.05-2

schroot recommends no packages.

Versions of packages schroot suggests:
pn aufs-tools | unionfs-fuse <none>
pn btrfs-progs <none>
ii bzip2 1.0.8-5
ii debootstrap 1.0.127
ii lvm2 2.03.16-1
ii qemu-user-static 1:7.0+dfsg-7+b1
ii xz-utils 5.2.5-2.1
pn zfsutils-linux <none>
ii zstd 1.5.2+dfsg-1

-- debconf information:
schroot/bad-names:

Christoph Biedl

unread,
Sep 24, 2022, 8:00:04 AM9/24/22
to
Controls: tags 1020277 confirmed pending

Arnaud Rebillout wrote...

> in a chroot I need to install systemd-resolved. systemd-resolved creates
> a symlink etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf,
> which is a dangling symlink.
>
> Consequently, schroot fails to start the chroot:
>
> E: 20copyfiles: cp: not writing through dangling symlink '<<CHROOT>>/etc/resolv.conf'
> E: <<CHROOT>>: Chroot setup failed: stage=setup-start

Yeah, stumbled upon this as well, thanks for taking a closer look.

Unless I'm mistaken, this was already fixed in the old 1.7 development
branch, in
https://codeberg.org/shelter/reschroot/commit/11587fd8761d5053fb1a3c0cdbed3d0486ce29f1

So I'll cherry-pick that one for the next upload.

Christoph
signature.asc

Christoph Biedl

unread,
Sep 25, 2022, 1:50:03 PM9/25/22
to
Control: tags 1020277 confirmed pending
Control: severity 1020277 important
Control: found 1020277 1.6.10-12+deb11u1

Christoph Biedl wrote...

> Yeah, stumbled upon this as well, thanks for taking a closer look.

This affects stable as well. So I'll add this to a list of things to
include in the next stable point release.

Christoph

signature.asc
0 new messages