diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-07-11 20:18:10 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-07-11 21:04:29 +0000 |
commit | afe7b9141ff0195abdee88aea8e15bda9c0f573f (patch) | |
tree | 55650542cd78eeb14c13228acef6b60c9f22096e /build.sh | |
parent | a4b0f4f26fd5f4b958039ae8fe64d821860f595d (diff) | |
download | midipix_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 'build.sh')
-rwxr-xr-x | build.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -88,16 +88,16 @@ if [ ${ARG_CLEAN:-0} -eq 1 ]; then log_msg info "-c specified, cleaning prefix..."; for __ in ${CLEAR_PREFIX_DIRS}; do if [ -e ${PREFIX}/${__} ]; then - rm -rf -- ${PREFIX}/${__}; + secure_rm ${PREFIX}/${__}; fi; done; fi; # Create directory hierarchy and usr -> . symlinks. -mkdir -p -- ${PREFIX} ${PREFIX_NATIVE} ${PREFIX_CROSS} ${PREFIX_TARGET}/lib ${DLCACHEDIR} ${WORKDIR}; +insecure_mkdir ${PREFIX} ${PREFIX_NATIVE} ${PREFIX_CROSS} ${PREFIX_TARGET}/lib ${DLCACHEDIR} ${WORKDIR}; for __ in ${PREFIX}/usr ${PREFIX_NATIVE}/usr; do if [ ! -L "${__}" ]; then - rm -rf -- "${__}"; ln -sf -- . "${__}"; + secure_rm "${__}"; ln -sf -- . "${__}"; fi; done; @@ -169,7 +169,7 @@ log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL log_msg info "Build time: ${BUILD_TIMES_HOURS} hour(s), ${BUILD_TIMES_MINUTES} minute(s), and ${BUILD_TIMES_SECS} second(s)."; if [ -f "${BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then - rm -f -- ${BUILD_STATUS_IN_PROGRESS_FNAME}; + secure_rm ${BUILD_STATUS_IN_PROGRESS_FNAME}; fi; exit ${BUILD_SCRIPT_RC})} 2>&1 | tee ${BUILD_LOG_FNAME} & |