summaryrefslogtreecommitdiffhomepage
path: root/pkg.build
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-07-11 20:18:10 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-07-11 21:04:29 +0000
commitafe7b9141ff0195abdee88aea8e15bda9c0f573f (patch)
tree55650542cd78eeb14c13228acef6b60c9f22096e /pkg.build
parenta4b0f4f26fd5f4b958039ae8fe64d821860f595d (diff)
downloadmidipix_build-afe7b9141ff0195abdee88aea8e15bda9c0f573f.tar.bz2
midipix_build-afe7b9141ff0195abdee88aea8e15bda9c0f573f.tar.xz
Replaces rm_if_exists() [-m] [-c] w/ secure_rm(), insecure_mkdir(), and secure_cd().
secure_{rm,cd}() verify whether all pathnames supplied are rooted beneath ${PREFIX_ROOT}.
Diffstat (limited to 'pkg.build')
-rw-r--r--pkg.build16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkg.build b/pkg.build
index 8d695535..b311768a 100644
--- a/pkg.build
+++ b/pkg.build
@@ -34,9 +34,9 @@ if test_cmd pkg_${PKG_NAME}_finish; then
pkg_${PKG_NAME}_finish; exit 0;
elif [ "${PKG_URL_TYPE:-wget}" = wget ] &&\
! is_build_script_done extract; then
- rm_if_exists ${PKG_SUBDIR};
+ secure_rm ${PKG_SUBDIR};
if [ ${PKG_SUBDIR_CREATE:-0} -eq 1 ]; then
- mkdir -- ${PKG_SUBDIR};
+ insecure_mkdir ${PKG_SUBDIR};
fi;
if [ "${PKG_FNAME##*.tar.}" = "bz2" ]; then
bunzip2 -d < ${DLCACHEDIR}/${PKG_FNAME} | tar ${PKG_SUBDIR_CREATE:+-C ${PKG_SUBDIR}} -xf -;
@@ -63,7 +63,8 @@ if [ -z "${PKG_BUILD_DIR}" ]; then
fi;
if ! is_build_script_done build_dir; then
[ "${PKG_SUBDIR}" != "${PKG_BUILD_DIR}" ] &&\
- rm_if_exists -m ${PKG_BUILD_DIR};
+ secure_rm ${PKG_BUILD_DIR};
+ insecure_mkdir ${PKG_BUILD_DIR};
set_build_script_done build_dir -patch;
fi;
if [ -e ${PKG_SUBDIR}/configure -o \
@@ -193,7 +194,9 @@ if ! is_build_script_done install; then
fi;
fi;
if [ -d ${PKG_PREFIX}/lib ]; then
- find ${PKG_PREFIX}/lib -type f -name \*.la -exec rm -f -- {} \;
+ for __ in $(find ${PKG_PREFIX}/lib -type f -name \*.la); do
+ secure_rm ${__};
+ done;
fi;
if [ -n "${PKG_INSTALL_FILES}" ]; then
(set -- ${PKG_INSTALL_FILES};
@@ -208,8 +211,7 @@ if ! is_build_script_done install; then
;;
/=*)
__mkdir_fname="${1#/=}";
- echo mkdir -p -- ${PKG_PREFIX}/${__mkdir_fname};
- mkdir -p -- ${PKG_PREFIX}/${__mkdir_fname};
+ insecure_mkdir ${PKG_PREFIX}/${__mkdir_fname};
;;
*)
__file_fname_src="${1%=*}";
@@ -225,7 +227,7 @@ if ! is_build_script_done install; then
$(find \( -name "*.so" \
-or -name "*.so.[0-9]" \
-or -name "*.so.[0-9].[0-9]" \
- -or -name "*.so.[0-9].[0-9].[0-9]" \) -printf "%P\n");
+ -or -name "*.so.[0-9].[0-9].[0-9]" \) -printf '%P\n');
do
if [ \( -e ${__so_fname%.so}.lib.a \) -o \
\( ! -e ${PKG_PREFIX}/lib/${__so_fname} \) ];