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

Bug#1015954: marked as done (unmkinitramfs and lsinitramfs don't dereference symlinks consistently)



Your message dated Mon, 09 Jun 2025 17:17:58 +0200
with message-id <01d2df59b811490bb0e206f9bcf6cd43229a4cb7.camel@decadent.org.uk>
and subject line Re: unmkinitramfs and lsinitramfs don't dereference symlinks consistently
has caused the Debian Bug report #1015954,
regarding unmkinitramfs and lsinitramfs don't dereference symlinks consistently
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1015954: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015954
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: initramfs-tools-core
Version: 0.142
Severity: normal
Tags: patch
File: /usr/bin/unmkinitramfs

Dear Maintainer,

With the default COMPRESS=zstd lsmkinitramfs fails on unsplit
/initrd.img:

    $ lsmkinitramfs /initrd.img
    cpio: premature end of archive
    $ unmkinitramfs /initrd.img /tmp/initramfs 
    cpio: premature end of archive

This is because zstd(1) refuses to operate on symlinks without `-f`:

    $ zstd -t /initrd.img
    Warning : /initrd.img is a symbolic link, ignoring 

(This is with an unsplit initramfs, so xcpio() processes the input file
directly.)  That behavior seems to be specific to zstd(1), at least
unmkinitramfs(8) does seem work with COMPRESS=gzip, bzip2, lz4, lzma,
lzop, xz.  All these utilities do process standard input though, so a
simple fix (attached) is to merely redirect it.

Thanks for maintaining initramfs-tools!
-- 
Guilhem.

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

Kernel: Linux 5.18.0-2-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages initramfs-tools-core depends on:
ii  coreutils    8.32-4.1
ii  cpio         2.13+dfsg-7
ii  e2fsprogs    1.46.5-2
ii  klibc-utils  2.0.10-4
ii  kmod         30+20220630-2
ii  logsave      1.46.5-2
ii  udev         251.3-1

Versions of packages initramfs-tools-core recommends:
ii  busybox  1:1.35.0-1
ii  zstd     1.5.2+dfsg-1

Versions of packages initramfs-tools-core suggests:
ii  bash-completion  1:2.11-6

-- Configuration Files:
/etc/initramfs-tools/initramfs.conf changed [not included]

-- no debconf information
--- a/unmkinitramfs
+++ b/unmkinitramfs
@@ -29,18 +29,18 @@
 	dir="$2"
 	shift 2
 
-	if gzip -t "$archive" >/dev/null 2>&1 ; then
-		gzip -c -d "$archive"
-	elif zstd -q -c -t "$archive" >/dev/null 2>&1 ; then
-		zstd -q -c -d "$archive"
-	elif xzcat -t "$archive" >/dev/null 2>&1 ; then
-		xzcat "$archive"
+	if gzip -t < "$archive" >/dev/null 2>&1 ; then
+		gzip -c -d < "$archive"
+	elif zstd -q -c -t < "$archive" >/dev/null 2>&1 ; then
+		zstd -q -c -d < "$archive"
+	elif xzcat -t < "$archive" >/dev/null 2>&1 ; then
+		xzcat < "$archive"
 	elif lz4cat -t < "$archive" >/dev/null 2>&1 ; then
-		lz4cat "$archive"
-	elif bzip2 -t "$archive" >/dev/null 2>&1 ; then
-		bzip2 -c -d "$archive"
-	elif lzop -t "$archive" >/dev/null 2>&1 ; then
-		lzop -c -d "$archive"
+		lz4cat < "$archive"
+	elif bzip2 -t < "$archive" >/dev/null 2>&1 ; then
+		bzip2 -c -d < "$archive"
+	elif lzop -t < "$archive" >/dev/null 2>&1 ; then
+		lzop -c -d < "$archive"
 	# Ignoring other data, which may be garbage at the end of the file
 	fi | (
 		if [ -n "$dir" ]; then

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Version: 0.148

This was incidentally fixed by the rewrite of unmkinitramfs, because it
now passes a compressed image to a decompressor as stdin rather than as
a filename.

Ben.

-- 
Ben Hutchings
It is a miracle that curiosity survives formal education.
                                                      - Albert Einstein

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---

Reply to: