From 54d4cc32af5a0514bcfe428aa36f44d8ee444dc2 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 21 Mar 2023 11:11:48 +0100 Subject: [PATCH] Set file permissions to `rw` (600) for newly created password files --- bashpass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bashpass b/bashpass index 3a4b8b2..25fc270 100755 --- a/bashpass +++ b/bashpass @@ -397,6 +397,10 @@ main() { printf 'email: %s\n' "${email}" >> "${config}" fi + # Restrict new password file permissions to only the + # current user. + umask 077 + case "${1}" in "--help"| "-h") help;; "--version"| "-v") version;;