From 03225ce5d69db519c385f5c47646f42f05434c36 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Wed, 8 Nov 2023 14:07:54 -0500 Subject: [PATCH 1/2] Fix compatibility with libpam-tmpdir. By creating folder the required temporary folder. fixes https://github.com/grml/grml-debootstrap/issues/232 --- grml-debootstrap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grml-debootstrap b/grml-debootstrap index 72bc7037..ad005c3f 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1811,6 +1811,8 @@ preparechroot() { [ -n "$TUNE2FS" ] && echo "TUNE2FS='$(sed "s,','\\\\'',g" <<<"${TUNE2FS}")'" >> "$CHROOT_VARIABLES" [ -n "$VMSIZE" ] && echo "VMSIZE='$(sed "s,','\\\\'',g" <<<"${VMSIZE}")'" >> "$CHROOT_VARIABLES" + [ -n "$TMPDIR" ] && mkdir --parents "${MNTPOINT}/${TMPDIR}" + cp $VERBOSE "${CONFFILES}"/chroot-script "${MNTPOINT}"/bin/chroot-script chmod 755 "${MNTPOINT}"/bin/chroot-script [ -d "$MNTPOINT"/etc/debootstrap/ ] || mkdir "$MNTPOINT"/etc/debootstrap/ From 4c1b09aa3eae54708d017c597a3bf35c1ccc98b4 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Wed, 8 Nov 2023 17:57:39 -0500 Subject: [PATCH 2/2] Set sticky bit if creating a temporary folder for better security. --- grml-debootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grml-debootstrap b/grml-debootstrap index ad005c3f..bd298745 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -1811,7 +1811,7 @@ preparechroot() { [ -n "$TUNE2FS" ] && echo "TUNE2FS='$(sed "s,','\\\\'',g" <<<"${TUNE2FS}")'" >> "$CHROOT_VARIABLES" [ -n "$VMSIZE" ] && echo "VMSIZE='$(sed "s,','\\\\'',g" <<<"${VMSIZE}")'" >> "$CHROOT_VARIABLES" - [ -n "$TMPDIR" ] && mkdir --parents "${MNTPOINT}/${TMPDIR}" + [ -n "$TMPDIR" ] && mkdir --parents "${MNTPOINT}/${TMPDIR}" && chmod 1777 "${MNTPOINT}/${TMPDIR}" cp $VERBOSE "${CONFFILES}"/chroot-script "${MNTPOINT}"/bin/chroot-script chmod 755 "${MNTPOINT}"/bin/chroot-script