]> andersk Git - moira.git/blobdiff - gen/install_dirs
Command line printer manipulation client, and build goo.
[moira.git] / gen / install_dirs
index 35f29531cefd5f9f0e464562852dd34ad487f978..72ee5894e4a985c0df917abea7b83b6e7af18119 100644 (file)
@@ -1,31 +1,16 @@
 #!/bin/csh -f
-# This script installs new directories on NFS servers. 
+# This script installs new directories on NFS servers.
 
 # The following exit codes are defined and MUST BE CONSISTENT with the
-# SMS error codes the library uses:
-set SMS_PROTO = 47836477
+# error codes the library uses:
+set MR_PROTO = 47836477
 
 set path=(/etc /bin /usr/bin /usr/etc)
 
 # Find out what device we're working on
 set dev = $1
 
-set TMPSTOR = /tmp/tmpstor     # Temporary area for user . files
-set USERTAR = /tmp/proto.tar   # Tarfile for user . files
-
-# Give ourselves a fresh work area
-rm -rf $USERTAR
-rm -rf $TMPSTOR
-mkdir $TMPSTOR
-if ($status) exit $SMS_PROTO
-
-# Make a tarfile containing the user prototype files for future use.
-(cd /usr/prototype_user;tar cf - .) | (cd $TMPSTOR; tar xpf -)
-chmod -R 444 $TMPSTOR
-chmod 700 $TMPSTOR/Mail
-(cd $TMPSTOR; tar cf $USERTAR .)
-if ($status) exit $SMS_PROTO
-rm -rf $TMPSTOR
+set USERTAR = /tmp/nfs.dir/proto.tar   # Tarfile for user . files
 
 # So that the new directories get the right protections.
 umask 66
@@ -47,10 +32,10 @@ while (1)
       set tmpdir = $dir:h/_$dir:t
       # Don't clobber this directory if it exists.
       if (-d $tmpdir) then
-         continue
+        break;
       else
          mkdir $tmpdir
-         # At some point it may be wise to check the status here and 
+         # At some point it may be wise to check the status here and
          # return a soft failure, but the current protocol doesn't
          # support this
          break
@@ -59,22 +44,25 @@ while (1)
    if (! -d $tmpdir) continue
    chown $uid.$gid $tmpdir
 
-   # At some point, we may wish to add a more elegant way of handling 
-   # locker types.  The current arrangement allows for easy adding of 
+   # At some point, we may wish to add a more elegant way of handling
+   # locker types.  The current arrangement allows for easy adding of
    # default actions here.
    switch ($type)
       case HOMEDIR:
-         
+
          # ***** Remove this when /etc/encorce_quota becomes obsolete!
          # Give this filesystem a 1200K quota
          setquota $dev $uid 1200
          # *****
 
          # Give user prototype files
-         # sms_untar is a setuid argv[1] tar xfp -
-         (cd $tmpdir; sms_untar $uid < $USERTAR)
+         (cd $tmpdir; tar xf $USERTAR)
          if ($status) set WARN
-         breaksw      
+        chown $uid.$gid $tmpdir $tmpdir/.??* $tmpdir/*
+         breaksw
+      case COURSE:
+        /bin/chmod 775 $tmpdir
+        breaksw
       default:
          breaksw
    endsw
@@ -83,8 +71,6 @@ while (1)
    ### Soft failure when ready
 end
 
-# Cleanup
-rm -f $USERTAR
 exit 0
 
 #
This page took 0.027606 seconds and 4 git commands to generate.