Skip to content

Commit

Permalink
Reduce default permissions of config directory
Browse files Browse the repository at this point in the history
As the config directory may include secrets (read with privilege from
the system), use the least needed permissions when we are creating the
directory.

Fixes #142.
  • Loading branch information
CyberShadow committed Mar 20, 2022
1 parent c23211f commit 7698f9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ function AconfCompileOutput() {
touch "$output_dir"/foreign-packages.txt
touch "$output_dir"/file-props.txt
touch "$output_dir"/warnings
mkdir --parents "$config_dir"
# shellcheck disable=SC2174
mkdir --mode=700 --parents "$config_dir"

# Configuration

Expand Down
3 changes: 2 additions & 1 deletion src/save.bash
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ function AconfSave() {

local dir
dir="$(dirname "$file")"
mkdir --parents "$config_dir"/files/"$dir"
# shellcheck disable=SC2174
mkdir --mode=700 --parents "$config_dir"/files/"$dir"

local func args props suffix=''

Expand Down

0 comments on commit 7698f9a

Please sign in to comment.