From c52b1fa175b0bcc1bd2ec86ca7f4a926905dce0b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 17 Jun 2014 22:11:32 -0400 Subject: db-functions: add mv_acl --- db-functions | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'db-functions') 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=() -- cgit v1.2.3