summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-17 22:11:32 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-17 22:11:32 -0400
commitc52b1fa175b0bcc1bd2ec86ca7f4a926905dce0b (patch)
tree48378753d85e169453b797d9efa789d056d05c1b
parentad922cd1ea67945d538036b021d8ccf8f8b475b6 (diff)
db-functions: add mv_acl
-rw-r--r--db-functions9
1 files changed, 9 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index 52ad8bb..6b49e6a 100644
--- a/db-functions
+++ b/db-functions
@@ -15,6 +15,15 @@ restore_umask () {
umask $UMASK >/dev/null
}
+# 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"
+}
+
# set up general environment
WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX")
LOCKS=()