commit 77bde4fdaf467666a3f21edbea76de2b4fbfaf68 from: jrmu date: Mon Mar 06 23:03:06 2023 UTC fix permissions bugs commit - 04d70a974fdfafe4f25c4f2bdea8b5a3bd2bce6e commit + 77bde4fdaf467666a3f21edbea76de2b4fbfaf68 blob - 77990e440fd2824378c5b48d195c24f41cedb2d0 blob + 1d899ac615100c029b18e007fb58cf96fe26e16d --- Mail.pm +++ Mail.pm @@ -74,7 +74,8 @@ sub mmail { $line =~ s/^#(${username}\@${hostname}.*)/$1/; } # trailing newline necessary - `doas touch $passwdpath.bak` + `doas touch $passwdpath.bak`; + `doas chmod g+w $passwdpath.bak`; main::writefile("$passwdpath.bak", join("\n", @passwd)."\n"); copy "${passwdpath}.bak", $passwdpath; @@ -119,7 +120,8 @@ sub mmail { $line =~ s/^(${username}\@${hostname}.*)/#$1/; } # trailing newline necessary - `doas touch $passwdpath.bak` + `doas touch $passwdpath.bak`; + `doas chmod g+w $passwdpath.bak`; main::writefile("$passwdpath.bak", join("\n", @passwd)."\n"); copy "${passwdpath}.bak", $passwdpath; @@ -270,9 +272,10 @@ sub deletemail { @senders = grep !/^${username}\@${hostname}/, @virtuals; # trailing newline necessary - `doas touch $passwdpath.bak` - `doas touch $virtualspath.bak` - `doas touch $senderspath.bak` + `doas touch $passwdpath.bak`; + `doas touch $virtualspath.bak`; + `doas touch $senderspath.bak`; + `doas chmod g+w $passwdpath.bak $virtualspath.bak $senderspath.bak`; main::writefile("$passwdpath.bak", join("\n", @passwd)."\n"); copy "${passwdpath}.bak", $passwdpath; main::writefile("$virtualspath", join("\n", @virtuals)."\n");