Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Dec 18, 2017
1 parent bd82c96 commit 5353746
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/beesh.sh.in
Expand Up @@ -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"
Expand Down Expand Up @@ -612,15 +612,15 @@ function bee_pkg_pack() {
exit 1
fi

cp "${BEE}" "${D}/BUILD"
cp --no-preserve=mode "${BEE}" "${D}/BUILD"

create_meta

if [ -n "${bee_PATCHFILES[0]}" ] ; then
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
Expand Down Expand Up @@ -663,7 +663,7 @@ function bee_pkg_pack() {
mkdir -pv "${BEE_BEEDIR}"
fi

cp -v "${BEE}" "${beefiledest}"
cp --no-preserve=mode -v "${BEE}" "${beefiledest}"
}


Expand Down

0 comments on commit 5353746

Please sign in to comment.