summaryrefslogtreecommitdiffstats
path: root/cron-jobs/ftpdir-cleanup
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-01-07 12:08:30 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-20 09:41:42 +0100
commitc2ad0298b74877bb2cd85f8f0e899460714bb019 (patch)
tree10384de45da7f9aec772fd96788a268aef44ee1f /cron-jobs/ftpdir-cleanup
parent1609e48d3301dfc2c897ed22d413eb74260b6f4b (diff)
downloaddbscripts-c2ad0298b74877bb2cd85f8f0e899460714bb019.tar.gz
dbscripts-c2ad0298b74877bb2cd85f8f0e899460714bb019.tar.xz
ftpdir-cleanup: fix ACL issues on nymeria
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'cron-jobs/ftpdir-cleanup')
-rwxr-xr-xcron-jobs/ftpdir-cleanup13
1 files changed, 11 insertions, 2 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 15eb46c..e1294bd 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -3,6 +3,15 @@
. "$(dirname $0)/../config"
. "$(dirname $0)/../db-functions"
+# just like mv -f, but we touch the file and then copy the content so
+# default ACLs in the target dir will be applied
+mv_acl() {
+ rm -f "$2"
+ touch "$2"
+ cat "$1" >"$2" || return 1
+ rm -f "$1"
+}
+
clean_pkg() {
local pkg
local target
@@ -12,9 +21,9 @@ clean_pkg() {
if [ -h "$pkg" ]; then
rm -f "$pkg" "$pkg.sig"
else
- mv -f "$pkg" "$CLEANUP_DESTDIR"
+ mv_acl "$pkg" "$CLEANUP_DESTDIR/${pkg##*/}"
if [ -e "$pkg.sig" ]; then
- mv -f "$pkg.sig" "$CLEANUP_DESTDIR"
+ mv_acl "$pkg.sig" "$CLEANUP_DESTDIR/${pkg##*/}.sig"
fi
touch "${CLEANUP_DESTDIR}/${pkg##*/}"
fi