Annotation of researchv8dc/cmd/uucp/init/setlib, revision 1.1.1.1

1.1       root        1: # set up needed files in the uucp lib directory
                      2: # it is assumed that the target is the working directory
                      3: # and that any useful files from the old system are here
                      4: # nothing is removed, so some junk (old files) will be left.
                      5: 
                      6: PERM=Permissions
                      7: DIAL=Dialcodes
                      8: SYSTEM=Systems
                      9: LSYS=L.sys
                     10: LDIAL=L.dialcodes
                     11: LDEVICES=L.devices
                     12: UUCP=uucp
                     13: GUUCP=bin
                     14: CMDS=L.cmds
                     15: PROCCTL=/etc/procctl
                     16: 
                     17: PATH=/bin:/usr/bin:/etc:.
                     18: #
                     19: # L.sys -> Systems
                     20: # just rename them
                     21: #
                     22: rm -f L.sysequiv               # for sanity
                     23: for lsys in $LSYS*; do
                     24:        base=`expr $lsys : 'L.sys\(\..*\)'`
                     25:        if [ "$base" = ".general" ]; then
                     26:                base=.gen       # keep it short
                     27:        fi
                     28:        mv $lsys $SYSTEM$base
                     29:        chown $UUCP $SYSTEM$base
                     30:        chgrp $GUUCP $SYSTEM$base
                     31:        chmod 0660 $SYSTEM$base
                     32: done
                     33: 
                     34: #
                     35: # L.dialcodes -> Dialcodes
                     36: # just rename
                     37: #
                     38: if [ ! -f $DIAL ]; then
                     39:        if [ -f $LDIAL ]; then
                     40:                mv $LDIAL $DIAL
                     41:        else
                     42:                >$DIAL
                     43:        fi
                     44:        chown $UUCP $DIAL
                     45:        chgrp $GUUCP $DIAL
                     46:        chmod 664 $DIAL
                     47: fi
                     48: 
                     49: #
                     50: # L.devices -> Devices
                     51: # ignore existing one, use the shipped copy
                     52: # (which defines Datakit and dialout(3))
                     53: #
                     54: 
                     55: #
                     56: # Permissions
                     57: # start from scratch:
                     58: # allow all uucp logins in the password file
                     59: # (anyone who has uuci or uucico for shell)
                     60: # and any user-ids used by datakit for uucp service
                     61: # steal commands list from L.cmds
                     62: #
                     63: if [ -f $PERM ]; then
                     64:        exit
                     65: fi
                     66: > $PERM
                     67: set - `sed -n "/uuci/s/:.*//p" /etc/passwd`
                     68: for i
                     69: do
                     70:        echo "LOGNAME=$i"
                     71: done > $PERM
                     72: exec <$PROCCTL
                     73: while read x what x user prog junk; do
                     74:        if [ "$what" = uucp ]; then
                     75:                echo "LOGNAME=$user" >>$PERM
                     76:        fi
                     77: done
                     78: if [ -r $CMDS ]; then
                     79:        set - `sed -e 's/.*[    ]//' $CMDS`
                     80:        for i
                     81:        do
                     82:                if [ -z "$clist" ]; then
                     83:                        clist="$i"
                     84:                else
                     85:                        clist="$clist:$i"
                     86:                fi
                     87:        done
                     88:        echo "MACHINE=OTHER \\
                     89:        COMMANDS=$clist" >>$PERM
                     90:        rm $CMDS
                     91: fi
                     92: 
                     93: chown $UUCP $PERM
                     94: chgrp $GUUCP $PERM
                     95: chmod 664 $PERM

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.