1 &version 2
2 &- ***********************************************************
3 &- * *
4 &- * Copyright, C Honeywell Information Systems Inc., 1982 *
5 &- * *
6 &- * Copyright c 1972 by Massachusetts Institute of *
7 &- * Technology and Honeywell Information Systems, Inc. *
8 &- * *
9 &- ***********************************************************
10 &-
11 &- utility functions for system admin operations
12 &-
13 &- Modification history:
14 &- Modified 1984-12-11, BIM: summarize_sys_log, new value, V2
15 &- Modified 1985-02-18, E. Swenson: Prevent eor from asking questions
16 &- when there are problems with the segment to be printed.
17 &-
18 &trace &command off
19 &goto &1
20 &-
21 &label del
22 &if ¬ exists argument &2 &then &quit
23 &if &exists file &2 &then answer yes -bf delete &2
24 &quit
25 &-
26 &label dp
27 &label dprint
28 &if ¬ value_defined -pn sys_admin &3_addr &then &quit
29 &if ¬ exists argument &2 &then &quit
30 &if ¬ exists file &2 &then &quit
31 set_acl &2 r IO.SysDaemon
32 answer no eor -bf -he value_get -pn sys_admin &3_addr -ds value_get -pn sys_admin &3_dest &2 -q default default &4
33 &quit
34 &-
35 &label check_access
36 &- usage: ec util check_access OBJECT MODE name
37 &if exists argument &4 &then &set USER "-user &4"
38 &else &set USER ""
39 &set ACCESS &get_effective_access &2 &USER
40 &set X 1
41 &label _loop_check_access
42 &if &ngreater &X length &3 &then &goto _done_check_access
43 &if &equal 0 index &ACCESS substr &3 &X 1
44 &then &do
45 &if &is_af &then &return false
46 &else &do
47 &print Warning: &default You &4 lack &substr &3 &X 1 access to &2.
48 &quit
49 &end
50 &end
51 &set X &plus &X 1
52 &goto _loop_check_access
53 &label _done_check_access
54 &if &is_af &then &return true
55 &quit
56
57 &label &1
58 &print Invalid call to util.ec -- first argument &1
59 &quit
60 &- end