From 5353746a21ec54cd3427c91b63f72bdacfccc367 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 18 Dec 2017 11:00:59 +0100 Subject: [PATCH] beesh: Force defined mode for copies of source files The bee source file and the package source and patch files are copied into the bee package, the bee archive directory and into the build archive with `cp`. The modes of the source files are more or less undefined. Most notably this is true for the bee source files themself, because git doesn't store all file permissions in the repository, just the "x" bit. Add `--no-preserve=mode` option to `cp` so that the undefined modes are not inherited. The umask of the processes running bee is already defined to 022. --- src/beesh.sh.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 3fddef6..c419363 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -262,7 +262,7 @@ function fetch_one_file() { if [ "${url:0:1}" = "/" ] ; then print_info "copying file ${url}" - cp -v "${url}" "${F}/${file}" + cp --no-preserve=mode -v "${url}" "${F}/${file}" else if [ "${url:0:5}" == "https" ] ; then nocheck="--no-check-certificate" @@ -612,7 +612,7 @@ function bee_pkg_pack() { exit 1 fi - cp "${BEE}" "${D}/BUILD" + cp --no-preserve=mode "${BEE}" "${D}/BUILD" create_meta @@ -620,7 +620,7 @@ function bee_pkg_pack() { mkdir -pv "${D}/PATCHES" fi for p in "${bee_PATCHFILES[@]}" ; do - cp "${p}" "${D}/PATCHES" + cp --no-preserve=mode "${p}" "${D}/PATCHES" done if [ ! -d "${BEE_PKGDIR}" ] ; then @@ -663,7 +663,7 @@ function bee_pkg_pack() { mkdir -pv "${BEE_BEEDIR}" fi - cp -v "${BEE}" "${beefiledest}" + cp --no-preserve=mode -v "${BEE}" "${beefiledest}" }