summaryrefslogtreecommitdiff
path: root/sfeed_update
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2020-02-23 19:37:38 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2020-02-23 19:37:38 +0100
commitbbe2f3fc9a4b7360ca20d71eaa973e8b1c30b0f6 (patch)
treec76617f5f3a6f5eaf9d4ec40b5e50ad218cbe7a2 /sfeed_update
parent6603a965948b1426a254603da8b28b841836a37b (diff)
sfeed_update: don't preserve permissions of tmp files by moving, so copy
noticed on DragonFlyBSD where it prints a warning when moving the file from /tmp. To reproduce it: touch /tmp/file mv /tmp/file ~/ On other systems this would not print a warning, but it would preserve the group permissions etc.
Diffstat (limited to 'sfeed_update')
-rwxr-xr-xsfeed_update7
1 files changed, 4 insertions, 3 deletions
diff --git a/sfeed_update b/sfeed_update
index 3b1476f..398c408 100755
--- a/sfeed_update
+++ b/sfeed_update
@@ -143,11 +143,12 @@ feed() {
fi
rm -f "${tmpfeedfile}.merge"
- # atomic move.
- if ! mv "${tmpfeedfile}.order" "${sfeedfile}"; then
- log "${name}" "FAIL (MOVE)"
+ # copy
+ if ! cp "${tmpfeedfile}.order" "${sfeedfile}"; then
+ log "${name}" "FAIL (COPY)"
return
fi
+ rm -f "${tmpfeedfile}.order"
# OK
log "${name}" "OK"