Commit Diff
Diff:
04d70a974fdfafe4f25c4f2bdea8b5a3bd2bce6e
77bde4fdaf467666a3f21edbea76de2b4fbfaf68
Commit:
77bde4fdaf467666a3f21edbea76de2b4fbfaf68
Tree:
75d5e6d3b81cdf5d263bf11e2abf539bb074aed4
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Mon Mar 6 23:03:06 2023 UTC
Message:
fix permissions bugs
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");
IRCNow