[1569] in Moira

home help back first fref pref prev next nref lref last post

acl.sh change

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Sat Jun 3 21:50:32 2000

Message-Id: <200006040150.VAA01955@riff-raff-w20.mit.edu>
To: moiradev@MIT.EDU
Date: Sat, 03 Jun 2000 21:50:28 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	This is vaguely gross, but solves the problem of needing modify
the passwd.local that moira produces for drugstore before its suitable
to be used as /etc/passwd on the machine.  The patch basically just adds
a hook to run a local machine specific script if it exists.

Garry

Index: acl.sh
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/acl.sh,v
retrieving revision 1.4
diff -c -r1.4 acl.sh
*** acl.sh	2000/05/08 18:30:29	1.4
--- acl.sh	2000/06/03 06:13:00
***************
*** 8,13 ****
--- 8,14 ----
  
  # The following exit codes are defined and MUST BE CONSISTENT with the
  # error codes the library uses:
+ MR_NOCRED=47836470
  MR_MISSINGFILE=47836473
  MR_MKCRED=47836474
  MR_TARERR=47836476
***************
*** 16,28 ****
  
  PATH=/bin:/usr/bin
  TARFILE=/var/tmp/acl.out
  
  # Alert if the tar file does not exist
  test -r $TARFILE || exit $MR_MISSINGFILE
  
  # Make a temporary directory to unpack the tar file into
! mkdir /var/tmp/acltmp || exit $MR_MKCRED
! cd /var/tmp/acltmp || exit $MR_MKCRED
  tar xpf $TARFILE || exit $MR_TARERR
  
  # Copy over each file which is new or has changed
--- 17,31 ----
  
  PATH=/bin:/usr/bin
  TARFILE=/var/tmp/acl.out
+ SRCDIR=/var/tmp/acltmp
  
  # Alert if the tar file does not exist
  test -r $TARFILE || exit $MR_MISSINGFILE
  
  # Make a temporary directory to unpack the tar file into
! rm -rf $SRCDIR
! mkdir $SRCDIR || exit $MR_MKCRED
! cd $SRCDIR || exit $MR_MKCRED
  tar xpf $TARFILE || exit $MR_TARERR
  
  # Copy over each file which is new or has changed
***************
*** 82,90 ****
      fi
  done
  
  # cleanup
  cd /
! rm -rf /var/tmp/acltmp
  test -f $TARFILE && rm -f $TARFILE
  test -f $0 && rm -f $0
  
--- 85,101 ----
      fi
  done
  
+ # Test if a site-specific post dcm script exists, and run it if it does
+ if [ -x /etc/athena/postacldcm ]; then
+     /etc/athena/postacldcm >/dev/null 2>&1
+     if [ $? != 0 ]; then
+ 	exit $MR_NOCRED
+     fi
+ fi
+ 
  # cleanup
  cd /
! rm -rf $SRCDIR
  test -f $TARFILE && rm -f $TARFILE
  test -f $0 && rm -f $0
  

home help back first fref pref prev next nref lref last post