From 55b72cc978ef5e68a9c17d5a88da1677467b32fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 28 Dec 2018 08:52:20 +0100 Subject: [PATCH] Fix permissions for creation and deletion --- make.iso.preseed.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/make.iso.preseed.sh b/make.iso.preseed.sh index c284c20..71fc3dc 100755 --- a/make.iso.preseed.sh +++ b/make.iso.preseed.sh @@ -84,6 +84,8 @@ fi wget -q "${USE_DEBIAN_ISO}" -O "${DEBIAN_DL_ISO_PATH}" command 7z x -o"${TEMP_ISO_DIR}" -- "${DEBIAN_DL_ISO_PATH}" > /dev/null rm -rf -- "${DEBIAN_DL_ISO_PATH}" +## Ensure to have the write permission on the extracted folder +chmod 0700 -- "${TEMP_ISO_DIR}" # }}} # Manage initrd.gz file {{{ mkdir -- "${TEMP_INITRD_DIR}" @@ -113,9 +115,13 @@ rm -rf -- "${TEMP_INITRD_DIR}" chmod -w -R -- $(dirname -- "${INITRD_GZ_PATH}") # }}} # Generate new md5sum {{{ +## Ensure to have the write permission on the iso folder +chmod 0700 -- "${TEMP_ISO_DIR}" cd -- "${TEMP_ISO_DIR}" > /dev/null || exit 2 ## Exclude some unwanted files find . -follow -type f -not \( -name "md5sum.txt" -o -name 'mkisofs' -o -name 'Bootable_NoEmulation.img' -o -path '*isolinux*' \) -exec md5sum {} \; > ./md5sum.txt +## Fix md5sum.txt permissions +chmod -w -- md5sum.txt cd - > /dev/null || exit 2 # }}} # Generate new bootable iso {{{ @@ -125,6 +131,7 @@ xorriso -as mkisofs -o "${DEBIAN_PRESEED_ISO_PATH}" \ -boot-load-size 4 -boot-info-table "${TEMP_ISO_DIR}" ## Then remove temp iso directory +chmod u+w -R -- "${TEMP_ISO_DIR}" rm -rf -- "${TEMP_ISO_DIR}" # }}}