fix: umask

fixes #38
This commit is contained in:
Ryan Mulligan 2021-05-12 20:11:17 -07:00
parent c27b6334a2
commit b69fd62fbb

View file

@ -19,7 +19,10 @@ let
echo "decrypting ${secretType.file} to ${secretType.path}..." echo "decrypting ${secretType.file} to ${secretType.path}..."
TMP_FILE="${secretType.path}.tmp" TMP_FILE="${secretType.path}.tmp"
mkdir -p $(dirname ${secretType.path}) mkdir -p $(dirname ${secretType.path})
(umask 0400; LANG=${config.i18n.defaultLocale} ${ageBin} --decrypt ${identities} -o "$TMP_FILE" "${secretType.file}") (
umask u=r,g=,o=
LANG=${config.i18n.defaultLocale} ${ageBin} --decrypt ${identities} -o "$TMP_FILE" "${secretType.file}"
)
chmod ${secretType.mode} "$TMP_FILE" chmod ${secretType.mode} "$TMP_FILE"
chown ${secretType.owner}:${secretType.group} "$TMP_FILE" chown ${secretType.owner}:${secretType.group} "$TMP_FILE"
mv -f "$TMP_FILE" '${secretType.path}' mv -f "$TMP_FILE" '${secretType.path}'