source: trunk/packs/maint/config_afs.sh @ 8230

Revision 8230, 1.7 KB checked in by ghudson, 28 years ago (diff)
Rather than turning off the setuid bits on all cells, use the new "listsuidcells" program to list all the setuid cells and turn off just those cells. This saves us from having to resolve hostnames for every cell in the CellServDB.
  • Property svn:executable set to *
Line 
1#!/bin/sh -
2#
3# $Id: config_afs.sh,v 1.11 1996-03-25 18:36:36 ghudson Exp $
4#
5# This script configures the workstation's notion of AFS.
6# 1. It updates the cell location information from /usr/vice/etc/CellServDB
7# 2. It updates the cell setuid information from /usr/vice/etc/SuidCells
8PATH=/bin:/bin/athena:/usr/bin; export PATH
9
10VICEDIR=/usr/vice/etc
11CELLDB=${VICEDIR}/CellServDB
12SUIDDB=${VICEDIR}/SuidCells
13
14echo "Updating cell location information"
15rm -f ${VICEDIR}/Ctmp
16cp /afs/athena.mit.edu/service/CellServDB ${VICEDIR}/Ctmp && \
17        [ -s ${VICEDIR}/Ctmp ] && \
18        mv -f ${VICEDIR}/Ctmp ${CELLDB}.public && \
19        cat ${CELLDB}.public ${CELLDB}.local >${VICEDIR}/Ctmp 2>/dev/null
20rm -f ${CELLDB}.last
21ln ${CELLDB} ${CELLDB}.last
22mv -f ${VICEDIR}/Ctmp ${CELLDB}
23chmod 644 ${CELLDB}
24
25cmp -s ${CELLDB}.last ${CELLDB} || \
26awk ' \
27          /^>/ {printf("\nfs newcell %s", substr($1,2,length($1)-1))}; \
28          /^[0-9]/ {printf(" %s",$1)}; \
29          END {printf("\n")}' ${CELLDB} | sh
30
31echo "Updating setuid cell information"
32rm -f ${VICEDIR}/Ctmp
33cp /afs/athena.mit.edu/service/SuidCells ${VICEDIR}/Ctmp && \
34        [ -s ${VICEDIR}/Ctmp ] && \
35        mv -f ${VICEDIR}/Ctmp ${SUIDDB}.public && \
36        cat ${SUIDDB}.public ${SUIDDB}.local >${VICEDIR}/Ctmp 2>/dev/null
37mv -f ${VICEDIR}/Ctmp ${SUIDDB}
38chmod 644 ${SUIDDB}
39
40echo "Only allowing setuid/setgid programs from the following cells:"
41
42/etc/athena/listsuidcells | xargs -icellname fs setcell cellname -nosuid
43cat ${SUIDDB} | awk '
44        /^-/    { suid[substr($1,2,length($1-1))] = 0; }
45                { suid[$1] = 1;
46                  cells[numcells++] = $1; }
47        END     { for (i = 0; i < numcells; i++) {
48                        if (suid[cells[i]]) {
49                                printf("fs setcell %s -suid\n", cells[i]);
50                                printf("echo %s\n", cells[i]); } } }' | sh
51
52exit 0
Note: See TracBrowser for help on using the repository browser.