From 257667f12a84858c2a404f7766323495043a78bc Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 25 Jul 2019 12:42:20 -0600 Subject: [PATCH] grant pilerUser permission to write to tmp dir --- .vscode/numbered-bookmarks.json | 4 ++-- pilerbackup.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index 854a757..59ab5b3 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -6,13 +6,13 @@ -1, 301, 46, + 386, -1, -1, -1, -1, -1, - -1, - -1 + 637 ] } ] diff --git a/pilerbackup.sh b/pilerbackup.sh index 906d59a..73903f6 100644 --- a/pilerbackup.sh +++ b/pilerbackup.sh @@ -391,6 +391,10 @@ printf "${cyan}[%s] -- [INFO] Exporting EML files from piler --${norm}\n" \ if ! exportDir=$( mktemp -d 2>>"$logFile" ); then exitError 111 "Could not create temporary directory for exported EML files" fi +# grant pilerUser permission to write to temporary directory +if ! chown root:${pilerUser} "$exportDir" && chmod 660 "$exportDir"; then + exitError 112 "Could not set permissions on temporary directory" +fi if ! cd "$exportDir"; then exitError 113 "Unable to change to temporary export directory" fi