fix: create header file manually to avoid mode 600

This commit is contained in:
ptrcnull 2022-07-30 07:55:18 +02:00
parent 24a42cdb5b
commit 0ca9d1c380

2
apatch
View file

@ -68,7 +68,7 @@ if [ -f "$patchpath" ]; then
msg "patch exists, trying to extract existing message"
# try to extract the original header from the patch
patch_start=$(grep -En '^(diff --git|--- )' "$patchpath" | cut -d: -f1 | head -n 1)
header_file="$(mktemp -t apatch.XXXXXX)"
header_file="/tmp/$(mktemp -u apatch.XXXXXX)"
head -n $(( patch_start - 1 )) "$patchpath" > "$header_file"
fi