X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/de9119ebe0d68c9612a579dd14920008f5accd44..dcfa270ac1d2f55eb793c4da4bbd555903a88b09:/gen/install_dirs diff --git a/gen/install_dirs b/gen/install_dirs index 376113a7..a5ce77ed 100644 --- a/gen/install_dirs +++ b/gen/install_dirs @@ -2,32 +2,15 @@ # 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 +# MR 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 -) -# Remove the welcome file. This may change. -rm -f $TMPSTOR/welcome -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 @@ -49,7 +32,7 @@ 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 @@ -68,15 +51,18 @@ while (1) case HOMEDIR: # ***** Remove this when /etc/encorce_quota becomes obsolete! - # Give this filesystem a 600K quota - setquota -u $dev $uid 600 + # 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 + chown $uid.$gid $tmpdir $tmpdir/.??* $tmpdir/* breaksw + case COURSE: + /bin/chmod 775 $tmpdir + breaksw default: breaksw endsw @@ -85,8 +71,6 @@ while (1) ### Soft failure when ready end -# Cleanup -rm -f $USERTAR exit 0 #