passwd since 1:4.11.1+dfsg1-1 creates an empty /var/mail/_apt

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-02-11 22:57:59 +01:00
parent e3a7b7d013
commit 88b9eaaad9
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -180,6 +180,7 @@ export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH
# compared to the one chosen in debootstrap because of different installation # compared to the one chosen in debootstrap because of different installation
# order in comparison to the systemd users # order in comparison to the systemd users
# https://bugs.debian.org/969631 # https://bugs.debian.org/969631
# we cannot use useradd because passwd is not Essential:yes
$CMD --variant=$variant --mode=$defaultmode \ $CMD --variant=$variant --mode=$defaultmode \
--essential-hook='if [ $variant = - ]; then echo _apt:*:100:65534::/nonexistent:/usr/sbin/nologin >> "\$1"/etc/passwd; fi' \ --essential-hook='if [ $variant = - ]; then echo _apt:*:100:65534::/nonexistent:/usr/sbin/nologin >> "\$1"/etc/passwd; fi' \
$dist /tmp/debian-$dist-mm.tar $mirror $dist /tmp/debian-$dist-mm.tar $mirror
@ -321,6 +322,18 @@ else
echo no difference for /etc/shadow- on $dist $variant >&2 echo no difference for /etc/shadow- on $dist $variant >&2
fi fi
# Because of unreproducible uids (#969631) we created the _apt user ourselves
# and because passwd is not Essential:yes we didn't use useradd. But passwd
# since 1:4.11.1+dfsg1-1 will create empty mail files, so we create it too.
# https://bugs.debian.org/1004710
if [ $variant = - ]; then
if [ -e /tmp/debian-$dist-debootstrap/var/mail/_apt ]; then
touch /tmp/debian-$dist-mm/var/mail/_apt
chmod 660 /tmp/debian-$dist-mm/var/mail/_apt
chown 100:8 /tmp/debian-$dist-mm/var/mail/_apt
fi
fi
# check if the file content differs # check if the file content differs
diff --unified --no-dereference --recursive /tmp/debian-$dist-debootstrap /tmp/debian-$dist-mm diff --unified --no-dereference --recursive /tmp/debian-$dist-debootstrap /tmp/debian-$dist-mm
@ -846,6 +859,7 @@ cmp /tmp/debian-chroot.tar /tmp/debian-chroot-shiftedback.tar
# manually adjust uid/gid and compare "tar -t" output # manually adjust uid/gid and compare "tar -t" output
tar --numeric-owner -tvf /tmp/debian-chroot.tar \ tar --numeric-owner -tvf /tmp/debian-chroot.tar \
| sed 's# 100/0 # 100100/100000 #' \ | sed 's# 100/0 # 100100/100000 #' \
| sed 's# 100/8 # 100100/100008 #' \
| sed 's# 0/0 # 100000/100000 #' \ | sed 's# 0/0 # 100000/100000 #' \
| sed 's# 0/5 # 100000/100005 #' \ | sed 's# 0/5 # 100000/100005 #' \
| sed 's# 0/8 # 100000/100008 #' \ | sed 's# 0/8 # 100000/100008 #' \