Create .lock-auto-reply with the correct owner

This commit is contained in:
Daniel Berteaud 2016-02-03 17:30:17 +01:00
parent 933356c428
commit a3704ba658
1 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,11 @@ foreach my $user (@users){
$user->set_prop('ExpireLockedOn', $now->ymd);
my $home = getpwnam($userName)->dir;
mkdir $home . '/.lock-auto-reply' unless -d $home . '/.lock-auto-reply';
if (!-d $home . '/.lock-auto-reply'){
mkdir $home . '/.lock-auto-reply';
chown getpwnam($userName)->uid, getpwnam($userName)->gid, $home . '/.lock-auto-reply';
chmod 750, $home . '/.lock-auto-reply';
}
esmith::templates::processTemplate ({
MORE_DATA => { USERNAME => $userName },
TEMPLATE_PATH => "/.lock-auto-reply/message.txt",