Google
 

Trailing-Edge - PDP-10 Archives - integ_tools_tops20_v7_30-apr-86_dumper - tools/com/prot.com
There are 3 other files named prot.com in the archive. Click here to see a list.
$! PROT.COM
$! Change protection of a file.
$! GMU	26-Jul-83 20:22	version 1.02
$!
$! This file is invoked via the PROTECT command (PRO*TECT :== @PROT.COM)
$! and takes one paramter as a file spec.  It then asks for the protection
$! codes for each class.  The command invocation looks like:
$!
$!	$ protect foo.bar
$!	$_System: rwed
$!	$_Owner: rwed
$!	$_Group: re
$!	$_World:
$!
$! In answer to the prompt, the user may give the standard codes, as
$! shown above.  In addition, there are three more legal responses.  A
$! "*" (without the quotes) is short for "rwed".  A "/" indicates that
$! the class is to have to privileges.  A carriage return with no code
$! indicates that that class should be left unchanged.
$!
$!
$ save_verify := 'f$verify(0)'			! Save and turn off verify
$ file := 'p1'
$ if file .eqs. "" then inquire file "$_file(s)"
$ inquire/local system "$_System"
$ inquire/local owner "$_Owner"
$ inquire/local group "$_Group"
$ inquire/local world "$_World"
$ punctuation = ""
$ string = ""
$!
$ if system .eqs. "" then goto checkowner
$ system = "SYSTEM:" + "''system'"
$ if system .eqs. "SYSTEM:*" then system = "SYSTEM:RWED"
$ if system .eqs. "SYSTEM:/" then system = "SYSTEM"
$ string = "''string'" + "''punctuation'" + "''system'"
$ punctuation = ","
CHECKOWNER:
$ if owner .eqs. "" then goto checkgroup
$ owner = "OWNER:" + "''owner'"
$ if owner .eqs. "OWNER:*" then owner = "OWNER:RWED"
$ if owner .eqs. "OWNER:/" then owner = "OWNER"
$ string = "''string'" + "''punctuation'" + "''owner'"
$ punctuation = ","
CHECKGROUP:
$ if group .eqs. "" then goto checkworld
$ group = "GROUP:" + "''group'"
$ if group .eqs. "GROUP:*" then group = "GROUP:RWED"
$ if group .eqs. "GROUP:/" then group = "GROUP"
$ string = "''string'" + "''punctuation'" + "''group'"
$ punctuation = ","
CHECKWORLD:
$ if world .eqs. "" then goto execute
$ world = "WORLD:" + "''world'"
$ if world .eqs. "WORLD:*" then world = "WORLD:RWED"
$ if world .eqs. "WORLD:/" then world = "WORLD"
$ string = "''string'" + "''punctuation'" + "''world'"
EXECUTE:
$ set protection=('string') 'file'
$ save_verify = 'f$verify(save_verify)'
$ exit