| |
|
| # Check for absolute paths in patches. If sandbox is disabled, |
# Check for absolute paths in patches. If sandbox is disabled, |
| # people could (accidently) patch files in the root filesystem. |
# people could (accidently) patch files in the root filesystem. |
| # Or trigger other unpleasantries #237667. |
# Or trigger other unpleasantries #237667. So disallow -p0 on |
| |
# such patches. |
| local abs_paths=$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }') |
local abs_paths=$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '$2 != "/dev/null" { print }') |
| if [[ -n ${abs_paths} ]] ; then |
if [[ -n ${abs_paths} ]] ; then |
| ewarn "Absolute paths found in ${patchname}! Please remove them!" |
count=1 |
| ewarn "${abs_paths}" |
echo "NOTE: skipping -p0 due to absolute paths in patch:" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/} |
| |
echo "${abs_paths}" >> ${STDERR_TARGET%/*}/${patchname}-${STDERR_TARGET##*/} |
| fi |
fi |
| |
|
| # Allow for prefix to differ ... im lazy, so shoot me :/ |
# Allow for prefix to differ ... im lazy, so shoot me :/ |