]> andersk Git - moira.git/blobdiff - incremental/afs_utils.pl
Don't try to do a get_user_account_by_login with a username longer than 8
[moira.git] / incremental / afs_utils.pl
index 29c47389f4e90a5c784d7df98f206283312de1c4..f64579b0f1dbb5be8bca5c7b02f4416bf9ccafd1 100644 (file)
@@ -1,3 +1,5 @@
+# $Header$
+
 $afsbin="/moira/bin";
 $vos="$afsbin/vos";
 $pts="$afsbin/pts";
@@ -9,6 +11,21 @@ $afs_save="$afs_data.tmp";
 $LOCK_EX=2;
 $LOCK_UN=8;
 
+%vtypes_ATHENA_MIT_EDU =
+    ("ACTIVITY", "activity",
+     "APROJ", "aproj",
+     "AREF", "aref",
+     "CONTRIB", "contrib",
+     "COURSE", "course",
+     "HOMEDIR", "user",
+     "LEASE", "dept",
+     "PROJECT", "project",
+     "REF", "ref",
+     "SW", "sw",
+     "SYSTEM", "system",
+     "UROP", "urop",
+     );
+
 # File format:
 #    cell server partition total used alloc
 
@@ -54,16 +71,20 @@ sub afs_unlock
 
 sub afs_find
 {
-    local($cell,$type,$quota) = @_;
-    local($j);
-    local(@max) = '';
+    local($cell,$type,$quota,@except) = @_;
+    local($j,$k);
+    local(@max) = ("", "", -10000000);
 
     &afs_lock;
     chop(@afs_data);
 
+  sloop:
     for (@afs_data) {
        local ($a, $asrv, $apart, $t, $total, $used, $alloc) = split(/\s+/,$_);
        next if ($a ne $cell || !$total || $type !~ /$t/);
+       for $j (@except) {
+           next sloop if ($j eq $asrv);
+       }
        $alloc = $used if ($alloc < $used);
        $j = 2*$total - $used - $alloc;
        @max = ($asrv,$apart,$j) if (! @max || $j > $max[2]);
This page took 0.036543 seconds and 4 git commands to generate.