commit 3cffb94e5cc47210ccb9177052e8b6c71d2c8cbb
parent 7b9e09795fcd43a55cd93cebd4fa96ab946ce5b9
Author: gryrmln <gryrmln@localhost>
Date: Fri, 2 Apr 2021 11:54:49 +0100
Handle /tmp/user/0 encroachment into dpkg scripts (zlibs/helpers)
Signed-off-by: gryrmln <gryrmln@localhost>
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/zlibs/helpers b/zlibs/helpers
@@ -213,12 +213,18 @@ chroot-script()
sudo chmod +x "$_path/$_script" || { zerr; return 1; }
sudo chroot "$_path" "/$_script" || { zerr; return 1; }
sudo mv -f "$_path/${_script}.log" "$R/log/"
+ # Some dpkg Debian scripts now expect "/tmp/user/0"
+ sudo mkdir -p "${_path}/tmp/user/0"
+ sudo chmod 0700 "${_path}/tmp/user/0"
+ sudo chmod 0600 "${_path}/tmp/user"
+ sudo chmod 1777 "${_path}/tmp"
if [[ -n "$_divert" ]]; then
dpkgdivert off "$_path" || { zerr; return 1; }
devprocsys umount "$_path" || { zerr; return 1; }
fi
+ sudo rm -rf "$_path/tmp/user"
sudo rm -f "$_path/$_script"
}