home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!news.UVic.CA!sanjuan!pmacdona
- From: pmacdona@sanjuan (Peter MacDonald)
- Subject: Permissions in SLS
- Message-ID: <1992Dec29.214548.3694@sol.UVic.CA>
- Sender: news@sol.UVic.CA
- Nntp-Posting-Host: sanjuan.uvic.ca
- Organization: University of Victoria, Victoria, BC, CANADA
- Date: Tue, 29 Dec 92 21:45:48 GMT
- Lines: 51
-
- Here is how I want to handle permission setting in SLS.
- Like just about all other administration, I want to use
- a shell script. So I intend to modify/extend install
- to allow it to modify files in place, plus a few other
- goodies documented briefly below in the very simple
- example I cobbled together.
-
- I intend to hook into rc.local to run this after the
- install is complete, and a reboot has occured.
- What I would like is feedback in the form of please
- add the following lines ...
-
- Here it is:
-
- Peter
- ---perms.sh------------------------------------------------
- #
- # Set the permissions in the system using a modified install
- # adding option -i for in place mods of files, and allowing
- # character mode specs (u+r) like in chmod. The -r option
- # specifies recursive behaviour. Also take multiple
- # directories on the command line. The advantage of a shell
- # script is that it allows extended semantics where needed.
- #
- install -d -o root -g root -m 755 bin
- install -d -o root -g root -m 755 usr
- install -d -o root -g root -m 755 lib
- install -d -o root -g root -m 755 home
- install -d -o root -g root -m 755 user
- install -d -o root -g root -m 755 mnt
- install -i -o root -g root -m 755 lib/*
- install -d -o root -g root -m 1777 tmp
- install -d -o root -g root -m 1777 usr/tmp
- install -d -o root -g root -m 755 usr/bin
- install -d -o root -g root -m 755 usr/lib
- install -r -i -o root -g root -m a+r usr/lib/*
- install -r -d -o root -g root -m a+rx usr/lib/*
- install -d -o root -g root -m 755 usr/man
- install -d -o root -g root -m 755 usr/man/*
- install -i -o root -g root -m 644 usr/man/*
- install -i -o root -g root -m 755 usr/man/*/*
- install -d -o root -g root -m 755 usr/spool
- install -d -o root -g root -m 755 usr/spool/mail
- install -d -o root -g root -m 755 usr/spool/uucp
- install -d -o root -g root -m 755 usr/adm
- for i in home/*; do
- install -d -o `basename $i` -g user -m 755 $i
- install -i -o `basename $i` -g user -m 755 $i/*
- touch usr/spool/mail/`basename $i`
- install -i -o `basename $i` -g mail -m 660 usr/spool/mail/`basename $i`
- done
-