From a3704ba65885e192e1082cda311440823c0a21ea Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 3 Feb 2016 17:30:17 +0100 Subject: [PATCH] Create .lock-auto-reply with the correct owner --- root/etc/e-smith/events/actions/user-expire-account | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/root/etc/e-smith/events/actions/user-expire-account b/root/etc/e-smith/events/actions/user-expire-account index b332d8a..1f597e5 100644 --- a/root/etc/e-smith/events/actions/user-expire-account +++ b/root/etc/e-smith/events/actions/user-expire-account @@ -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",