Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.kernel > #84095 > unrolled thread
| Started by | Thorsten Glaser <tg@mirbsd.de> |
|---|---|
| First post | 2024-09-24 03:00 +0200 |
| Last post | 2024-09-24 17:30 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.debian.kernel
Bug#1082647: copy_exec: [regression] ignores trailing slash, installs file as directory name Thorsten Glaser <tg@mirbsd.de> - 2024-09-24 03:00 +0200
Bug#1082647: copy_exec: [regression] ignores trailing slash, installs file as directory name Thorsten Glaser <tg@mirbsd.de> - 2024-09-24 17:30 +0200
| From | Thorsten Glaser <tg@mirbsd.de> |
|---|---|
| Date | 2024-09-24 03:00 +0200 |
| Subject | Bug#1082647: copy_exec: [regression] ignores trailing slash, installs file as directory name |
| Message-ID | <Jq24h-eoja-1@gated-at.bofh.it> |
Package: initramfs-tools-core Version: 0.142+deb12u1 Severity: serious Justification: hidden breakage for users, ought to be fixed in stable-pu X-Debbugs-Cc: tg@mirbsd.de In bullseye, this would work: copy_exec /usr/lib/klibc/bin/rnd_shuf /usr/libexec/ copy_exec /usr/sbin/rdate /usr/libexec/ In bookworm, the first line instead of copying the file rnd_shuf to /usr/libexec/rnd_shuf it copies it to /usr/libexec and the second does no better. Incidentally… copy_exec /usr/lib/klibc/bin/rnd_shuf /usr/libexec/ copy_exec /usr/sbin/rdate /usr/libexec/rdate … makes the second line fail: mkdir: cannot create directory ‘/var/tmp/mkinitramfs_eQ7nC7//usr/libexec’: File exists So copy_exec clearly still i̲s̲ capable of creating missing intermediate directories, but something made it stop honouring trailing slashes. I wonder what else, other than my script to enable the network interface, get the clocktime, and disable it again, on an RPi that has no RTC, will break on users’ systems from this. This really needs to be fixed in stable-pu. -- System Information: Debian Release: 12.7 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'proposed-updates'), (500, 'stable') Architecture: armel (armv6l) Kernel: Linux 6.1.0-25-rpi (UP) Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to C.UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/lksh Init: sysvinit (via /sbin/init) Versions of packages initramfs-tools-core depends on: ii coreutils 9.1-1 ii cpio 2.13+dfsg-7.1 ii e2fsprogs 1.47.0-2 ii klibc-utils 2.0.12-1 ii kmod 30+20221128-1 ii logsave 1.47.0-2 ii udev 252.30-1~deb12u2 Versions of packages initramfs-tools-core recommends: ii busybox 1:1.35.0-4+b3 ii zstd 1.5.4+dfsg2-5 Versions of packages initramfs-tools-core suggests: pn bash-completion <none> -- Configuration Files: /etc/initramfs-tools/initramfs.conf changed: MODULES=dep BUSYBOX=auto KEYMAP=n COMPRESS=zstd DEVICE= NFSROOT=auto RUNSIZE=10% FSTYPE=auto -- no debconf information
[toc] | [next] | [standalone]
| From | Thorsten Glaser <tg@mirbsd.de> |
|---|---|
| Date | 2024-09-24 17:30 +0200 |
| Message-ID | <JqfEd-exah-5@gated-at.bofh.it> |
| In reply to | #84095 |
On Tue, 24 Sep 2024, Ben Hutchings wrote:
>I suppose I can make this work again for bookworm, but I won't do so
>for unstable.
Then, perhaps issue a visible warning so that people can change
their scripts?
>This was not an intended feature. When specifiing a diectory as the
>target you are supposed to ensure that it already exists under
>${DESTDIR}. It seems that this just happened to work when the target
>name ended in a slash.
Hmmh, but this is used in so many other places, e.g. dh_install
does that, and many of the other scripts also don’t place filenames
after directories, they are just lucky that the directories exist
then.
But, wait, copy_exec *DOES* create missing directories, so this
*does* look like intended behaviour to me…
>The changes in the last point release to avoid duplicating files
>accessed via directory symlinks broke that because realpath strips the
>trailing slash.
Hmh.
IMHO we have two ways we can go from here (also towards sid).
One, repair this. If there is a trailing slash, it’s supposed
to be placed into that directory, then create that if missing.
That is, make bullseye’s behaviour the intended one.
Two, say people are expected to create the directories first.
But in that case, copy_exec also must not create any missing
directories any more *at all*, and additionally, if the target
ends in a slash in the argv (i.e. before realpathisation), it
still must be interpreted as the name of a directory (or symlink
to a directory), so that copying to '/usr/libexec/' will either
work (if pre-created) or fail (if not pre-created). These two
are needed for consistency and to have a sensitive failure mode
for users’ scripts, as opposed to create /usr/libexec as file.
bye,
//mirabilos
--
22:20⎜<asarch> The crazy that persists in his craziness becomes a master
22:21⎜<asarch> And the distance between the craziness and geniality is
only measured by the success 18:35⎜<asarch> "Psychotics are consistently
inconsistent. The essence of sanity is to be inconsistently inconsistent
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.kernel
csiph-web