]> andersk Git - moira.git/blobdiff - incremental/afs_create.pl
add a cast from unsigned char * to char * for Irix n32 cc
[moira.git] / incremental / afs_create.pl
index 59e0cfed6bc88575355ae7e2a2f3287d4a3f5b32..4d9bfd29b48c6e7966ec9ec8becfc27126b1ec83 100644 (file)
@@ -16,7 +16,7 @@ die "Usage: $0 locker type cell path user group\n" if (@ARGV != 6);
 
 # Lookup volume type
 ($c = $cell) =~ s/\./_/g;
-$vtype = eval "\$vtypes_$c{$type}";
+$vtype = eval "\$vtypes_${c}{$type}";
 die "Cannot create $type volumes in $cell\n" unless $vtype;
 $vname = $vtype . "." . $locker;
 $vname =~ s/[^-A-Za-z0-9_.]//g;                # strip out illegal characters
@@ -100,7 +100,7 @@ sub athena_proc
     # COURSE    <user> all <group> all system:facdev all system:authuser rl
     # HOMEDIR   <user> all
     # LEASE    <user> all
-    # ORG      <user> all <group> all system:cwisfac all
+    # ORG      <user> all <group> all system:cwisfac all system:anyuser rl
     # PROJECT   <user> all <group> all
     # REF       <user> all system:anyuser rl
     # SW        <user> all system:swmaint all system:authuser rl
@@ -123,7 +123,7 @@ sub athena_proc
     push(@acl,"system:authuser rl")
        if ($type =~ /^(COURSE|SW|UROP)/);
     push(@acl,"system:anyuser rl")
-       if ($type =~ /^(ACTIVITY|APROJ|CONTRIB|REF|SYSTEM)/);
+       if ($type =~ /^(ACTIVITY|APROJ|CONTRIB|ORG|REF|SYSTEM)/);
 
     if ($type !~ /^(AREF|ORG|SYSTEM)/) {
        system("$fs mkm $path/OldFiles $vname.backup");
@@ -131,16 +131,16 @@ sub athena_proc
     }
 
     if ($type =~ /ACTIVITY|APROJ|PROJECT/) {
-       chown($gid,0,$path) ||
-           die "Unable to set volume ownership\n";
+       system("/moira/bin/uchown $path $gid");
+       die "Unable to set volume ownership\n" if ($?);
     } elsif ($type =~ /HOMEDIR|UROP/) {
        chown($uid,0,$path) ||
            die "Unable to set volume ownership\n";
     }
 
-    if ($type eq "ORG") {
+    if ($type eq "COURSE") {
        mkdir("$path/www",0755) &&
-           chown(0,0,"$path/www") || 
+           chown(0,0,"$path/www") ||
                die "Unable to create subdirectories\n";
        system("$fs sa $path/www @acl system:anyuser rl -clear") &&
            die "Unable to set acl on www directory\n";
@@ -153,11 +153,13 @@ sub athena_proc
     if ($type eq "HOMEDIR") {
        die "Unable to get uid for user\n" unless ($uid);
 
-       mkdir("$path/Public",0755) && chown($uid,0,"$path/Public") &&
+       chmod(0755, $path);
+       mkdir("$path/Public",0755) && mkdir("$path/www",0755) &&
            mkdir("$path/Private",0700) && mkdir("$path/Mail", 0700) &&
-               chown($uid,0,"$path/Public","$path/Private","$path/Mail") ||
-                   die "Unable to create subdirectories\n";
-       system("$fs sa $path/Public @acl system:anyuser rl -clear") &&
+               chown($uid,0,"$path/Public","$path/www",
+                     "$path/Private","$path/Mail") ||
+                         die "Unable to create subdirectories\n";
+       system("$fs sa -dir $path/Public $path/www -acl @acl system:anyuser rl -clear") &&
            die "Unable to set acl on Public directory";
        system("$fs sa -dir $path/Private $path/Mail -acl @acl -clear") &&
            die "Unable to set acl on Private and/or Mail directories\n";
This page took 0.033198 seconds and 4 git commands to generate.