From c739c02167aa759335335a360d2a76211100f446 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 7 Dec 2011 20:50:32 +0000 Subject: [PATCH] better logging --- lam/lib/lamdaemon.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lam/lib/lamdaemon.pl b/lam/lib/lamdaemon.pl index 834ab6a3..cbfad531 100755 --- a/lam/lib/lamdaemon.pl +++ b/lam/lib/lamdaemon.pl @@ -300,12 +300,12 @@ sub manageQuotas { while ($quota_temp1[$i]) { $j=0; @temp = split (',', $quota_temp1[$i]); - while ($temp[$j]) { - $quota[$i][$j] = $temp[$j]; - $j++; - } - $i++; + while ($temp[$j]) { + $quota[$i][$j] = $temp[$j]; + $j++; } + $i++; + } if ($vals[3] eq 'user') { $group=false; } else { $group=1; @@ -348,10 +348,11 @@ sub setQuotas { ($<, $>) = ($>, $<); # Get root privileges while ($quota[$i][0]) { $dev = Quota::getqcarg($quota[$i][0]); + last if ($dev eq ''); $return = Quota::setqlim($dev,$user[2],$quota[$i][1],$quota[$i][2],$quota[$i][3],$quota[$i][4],1,$group); if ($return == -1) { $return = "ERROR,Lamdaemon ($hostname),Unable to set quota!"; - logMessage(LOG_ERR, "Unable to set quota for $user[0]."); + logMessage(LOG_ERR, "Unable to set quota for $user[0] on " . $quota[$i][0] . "."); } else { logMessage(LOG_INFO, "Set quota for $user[0].");