1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 ^L
37 compare_paths_: proc (PATH1, PATH2, SAME, CODE);
38
39 dcl PATH1 char (*);
40 dcl PATH2 char (*);
41 dcl SAME fixed bin (17);
42 dcl CODE fixed bin (35);
43
44 dcl uid1 bit (36) aligned;
45 dcl uid2 bit (36) aligned;
46
47 dcl dirname char (168) aligned;
48 dcl entryname char (32) aligned;
49
50 dcl chase fixed bin (1) init (1);
51 dcl code fixed bin (35);
52 dcl pname_len fixed bin (17);
53
54 dcl area_ptr ptr init (null ());
55
56 dcl 1 branch aligned,
57 2 (type bit (2),
58 nnames bit (16),
59 nrp bit (18),
60 dtm bit (36),
61 dtu bit (36),
62 mode bit (5),
63 padding bit (13),
64 records bit (18),
65 dtd bit (36),
66 dtem bit (36),
67 acct bit (36),
68 curlen bit (12),
69 bitcnt bit (24),
70 did bit (4),
71 mdid bit (4),
72 copysw bit (1),
73 pad2 bit (9),
74 rbs (0:2) bit (6),
75 uid bit (36)) unaligned;
76
77 dcl addr builtin;
78 dcl length builtin;
79 dcl null builtin;
80
81 dcl expand_path_ ext entry (ptr, fixed bin (17), ptr, ptr, fixed bin (35));
82 dcl hcs_$status_long ext entry (char (*) aligned, char (*) aligned, fixed bin (1), ptr, ptr, fixed bin (35));
83 dcl error_table_$no_s_permission ext fixed bin (35);
84 ^L
85 if PATH1 = PATH2 then do;
86 SAME = 1;
87 code = 0;
88 goto finish;
89 end;
90
91
92
93 SAME = 1;
94
95 begin;
96
97 dcl dirname_ptr ptr init (addr (dirname));
98 dcl entryname_ptr ptr init (addr (entryname));
99 dcl eptr ptr init (addr (branch));
100
101 call expand_path_ (addr (PATH1), length (PATH1), dirname_ptr, entryname_ptr, code);
102 if code ^= 0 then go to finish;
103 call hcs_$status_long (dirname, entryname, chase, eptr, area_ptr, code);
104 if code = error_table_$no_s_permission then goto no_status;
105 if code ^= 0 then go to finish;
106 uid1 = uid;
107 SAME = 2;
108 call expand_path_ (addr (PATH2), length (PATH2), dirname_ptr, entryname_ptr, code);
109 if code ^= 0 then go to finish;
110 call hcs_$status_long (dirname, entryname, chase, eptr, area_ptr, code);
111 if code = error_table_$no_s_permission then goto no_status;
112 if code ^= 0 then go to finish;
113 uid2 = uid;
114 if uid1 = uid2
115 then SAME = 1;
116 else SAME = 0;
117 end;
118 finish:
119 CODE = code;
120 return;
121
122 no_status:
123 goto finish;
124
125 end compare_paths_;