mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 04:05:40 +03:00
nixos/postgresqlBackup: set to umask to 0077
* Ensure that the backup file is only readable by the owner * Add file permission test to tests
This commit is contained in:
parent
0d30f7b023
commit
a0371d4761
2 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,8 @@ let
|
|||
'';
|
||||
|
||||
script = ''
|
||||
umask 0077 # ensure backup is only readable by postgres user
|
||||
|
||||
if [ -e ${cfg.location}/${db}.sql.gz ]; then
|
||||
${pkgs.coreutils}/bin/mv ${cfg.location}/${db}.sql.gz ${cfg.location}/${db}.prev.sql.gz
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue