r16572: More comments and simple refactoring of one condition.
[Samba/ekacnet.git] / source4 / torture / basic / denytest.c
blob9b9be967b1a27c852a0a562380ee387f4a5d1087
1 /*
2 Unix SMB/CIFS implementation.
3 SMB torture tester - deny mode scanning functions
4 Copyright (C) Andrew Tridgell 2001
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "includes.h"
22 #include "torture/torture.h"
23 #include "system/filesys.h"
24 #include "libcli/raw/libcliraw.h"
25 #include "libcli/libcli.h"
26 #include "torture/util.h"
28 extern BOOL torture_showall;
29 extern int torture_failures;
31 #define CHECK_MAX_FAILURES(label) do { if (++failures >= torture_failures) goto label; } while (0)
33 enum deny_result {A_0=0, A_X=1, A_R=2, A_W=3, A_RW=5};
35 static const char *denystr(int denymode)
37 const struct {
38 int v;
39 const char *name;
40 } deny_modes[] = {
41 {DENY_DOS, "DENY_DOS"},
42 {DENY_ALL, "DENY_ALL"},
43 {DENY_WRITE, "DENY_WRITE"},
44 {DENY_READ, "DENY_READ"},
45 {DENY_NONE, "DENY_NONE"},
46 {DENY_FCB, "DENY_FCB"},
47 {-1, NULL}};
48 int i;
49 for (i=0;deny_modes[i].name;i++) {
50 if (deny_modes[i].v == denymode) return deny_modes[i].name;
52 return "DENY_XXX";
55 static const char *openstr(int mode)
57 const struct {
58 int v;
59 const char *name;
60 } open_modes[] = {
61 {O_RDWR, "O_RDWR"},
62 {O_RDONLY, "O_RDONLY"},
63 {O_WRONLY, "O_WRONLY"},
64 {-1, NULL}};
65 int i;
66 for (i=0;open_modes[i].name;i++) {
67 if (open_modes[i].v == mode) return open_modes[i].name;
69 return "O_XXX";
72 static const char *resultstr(enum deny_result res)
74 const struct {
75 enum deny_result res;
76 const char *name;
77 } results[] = {
78 {A_X, "X"},
79 {A_0, "-"},
80 {A_R, "R"},
81 {A_W, "W"},
82 {A_RW,"RW"}};
83 int i;
84 for (i=0;ARRAY_SIZE(results);i++) {
85 if (results[i].res == res) return results[i].name;
87 return "*";
90 static const struct {
91 int isexe;
92 int mode1, deny1;
93 int mode2, deny2;
94 enum deny_result result;
95 } denytable2[] = {
96 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
97 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
98 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
99 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_ALL, A_0},
100 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
101 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
102 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
103 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
104 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
105 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_READ, A_0},
106 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_READ, A_0},
107 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_READ, A_0},
108 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_NONE, A_RW},
109 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
110 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_NONE, A_W},
111 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_FCB, A_0},
112 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
113 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
114 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
115 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
116 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
117 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
118 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
119 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
120 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_RW},
121 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_R},
122 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_W},
123 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_READ, A_0},
124 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_READ, A_0},
125 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_READ, A_0},
126 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_NONE, A_RW},
127 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
128 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_W},
129 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
130 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
131 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
132 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
133 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
134 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
135 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
136 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
137 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
138 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
139 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
140 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
141 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_READ, A_RW},
142 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_READ, A_R},
143 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_READ, A_W},
144 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_NONE, A_RW},
145 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
146 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_W},
147 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
148 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
149 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
150 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_DOS, A_0},
151 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
152 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
153 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_ALL, A_0},
154 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
155 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
156 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
157 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
158 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
159 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_READ, A_0},
160 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_READ, A_0},
161 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_READ, A_0},
162 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_NONE, A_0},
163 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
164 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
165 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_FCB, A_0},
166 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
167 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
168 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
169 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
170 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
171 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
172 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
173 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
174 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
175 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
176 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
177 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
178 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
179 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
180 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
181 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
182 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
183 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
184 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
185 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
186 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
187 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
188 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
189 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
190 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
191 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
192 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
193 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
194 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
195 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
196 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
197 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
198 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
199 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
200 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
201 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
202 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
203 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
204 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
205 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
206 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
207 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
208 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
209 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
210 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
211 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
212 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
213 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_READ, A_0},
214 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
215 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
216 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
217 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
218 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
219 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
220 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
221 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
222 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
223 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
224 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
225 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
226 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
227 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
228 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
229 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_R},
230 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
231 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
232 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
233 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
234 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
235 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
236 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
237 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
238 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
239 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
240 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
241 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
242 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
243 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
244 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
245 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
246 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
247 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
248 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
249 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
250 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_R},
251 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
252 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
253 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
254 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
255 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
256 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
257 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
258 {1, O_RDWR, DENY_READ, O_RDWR, DENY_DOS, A_0},
259 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_DOS, A_0},
260 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_DOS, A_W},
261 {1, O_RDWR, DENY_READ, O_RDWR, DENY_ALL, A_0},
262 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_ALL, A_0},
263 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_ALL, A_0},
264 {1, O_RDWR, DENY_READ, O_RDWR, DENY_WRITE, A_0},
265 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
266 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
267 {1, O_RDWR, DENY_READ, O_RDWR, DENY_READ, A_0},
268 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_READ, A_0},
269 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_READ, A_0},
270 {1, O_RDWR, DENY_READ, O_RDWR, DENY_NONE, A_0},
271 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_NONE, A_0},
272 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_NONE, A_W},
273 {1, O_RDWR, DENY_READ, O_RDWR, DENY_FCB, A_0},
274 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_FCB, A_0},
275 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_FCB, A_0},
276 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
277 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
278 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_DOS, A_W},
279 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
280 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
281 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
282 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
283 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
284 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_W},
285 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
286 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
287 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_READ, A_0},
288 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
289 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
290 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
291 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
292 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
293 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
294 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
295 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
296 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_DOS, A_W},
297 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
298 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
299 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
300 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
301 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
302 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
303 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
304 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
305 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_READ, A_W},
306 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
307 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
308 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
309 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
310 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
311 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
312 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_DOS, A_RW},
313 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
314 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_DOS, A_W},
315 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_ALL, A_0},
316 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
317 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
318 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
319 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
320 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
321 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_READ, A_0},
322 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_READ, A_0},
323 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_READ, A_0},
324 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
325 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
326 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
327 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_FCB, A_0},
328 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
329 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
330 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_DOS, A_RW},
331 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
332 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_W},
333 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
334 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
335 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
336 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_RW},
337 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_R},
338 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_W},
339 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_READ, A_0},
340 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_READ, A_0},
341 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_READ, A_0},
342 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
343 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
344 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
345 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
346 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
347 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
348 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_DOS, A_RW},
349 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
350 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_W},
351 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
352 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
353 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
354 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
355 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
356 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
357 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_READ, A_RW},
358 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_READ, A_R},
359 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_READ, A_W},
360 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
361 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
362 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
363 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
364 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
365 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
366 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_DOS, A_0},
367 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_DOS, A_0},
368 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_DOS, A_0},
369 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_ALL, A_0},
370 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
371 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
372 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
373 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
374 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
375 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_READ, A_0},
376 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_READ, A_0},
377 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_READ, A_0},
378 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_NONE, A_0},
379 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
380 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
381 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_FCB, A_0},
382 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_FCB, A_0},
383 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_FCB, A_0},
384 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_DOS, A_0},
385 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_0},
386 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_0},
387 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
388 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
389 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
390 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
391 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
392 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
393 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
394 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
395 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
396 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
397 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
398 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
399 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_FCB, A_0},
400 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_0},
401 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_0},
402 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_DOS, A_0},
403 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_0},
404 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_0},
405 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
406 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
407 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
408 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
409 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
410 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
411 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
412 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
413 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
414 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
415 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
416 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
417 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_FCB, A_0},
418 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_0},
419 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_0},
420 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_DOS, A_0},
421 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_DOS, A_0},
422 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_DOS, A_0},
423 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_ALL, A_0},
424 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
425 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
426 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
427 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
428 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
429 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_READ, A_0},
430 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_READ, A_0},
431 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_READ, A_0},
432 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_NONE, A_0},
433 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_NONE, A_0},
434 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_NONE, A_0},
435 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_FCB, A_0},
436 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
437 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
438 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_DOS, A_0},
439 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
440 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_0},
441 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
442 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
443 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
444 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
445 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_R},
446 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
447 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_READ, A_0},
448 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_READ, A_0},
449 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_READ, A_0},
450 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_NONE, A_0},
451 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
452 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_0},
453 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
454 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
455 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
456 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_DOS, A_0},
457 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_0},
458 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_0},
459 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
460 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
461 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
462 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
463 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
464 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
465 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_READ, A_0},
466 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_READ, A_0},
467 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_READ, A_0},
468 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_NONE, A_0},
469 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_0},
470 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_0},
471 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
472 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
473 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
474 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_DOS, A_0},
475 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
476 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
477 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_ALL, A_0},
478 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
479 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
480 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
481 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
482 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
483 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_READ, A_0},
484 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_READ, A_0},
485 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_READ, A_0},
486 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_NONE, A_0},
487 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
488 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
489 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_FCB, A_0},
490 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
491 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
492 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
493 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
494 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
495 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
496 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
497 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
498 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
499 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
500 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
501 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
502 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
503 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
504 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
505 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
506 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
507 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
508 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
509 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
510 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
511 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
512 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
513 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
514 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
515 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
516 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
517 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
518 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
519 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
520 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
521 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
522 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
523 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
524 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
525 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
526 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
527 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
528 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
529 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_DOS, A_0},
530 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
531 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
532 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
533 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
534 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
535 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
536 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
537 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_READ, A_0},
538 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
539 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
540 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
541 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
542 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
543 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
544 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
545 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
546 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
547 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
548 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
549 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
550 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
551 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
552 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
553 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_R},
554 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
555 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
556 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
557 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
558 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
559 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
560 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
561 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
562 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
563 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
564 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
565 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_0},
566 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
567 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
568 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
569 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
570 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
571 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
572 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
573 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
574 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_R},
575 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
576 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
577 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
578 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
579 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
580 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
581 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
582 {0, O_RDWR, DENY_READ, O_RDWR, DENY_DOS, A_0},
583 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_DOS, A_0},
584 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_DOS, A_0},
585 {0, O_RDWR, DENY_READ, O_RDWR, DENY_ALL, A_0},
586 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_ALL, A_0},
587 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_ALL, A_0},
588 {0, O_RDWR, DENY_READ, O_RDWR, DENY_WRITE, A_0},
589 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
590 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
591 {0, O_RDWR, DENY_READ, O_RDWR, DENY_READ, A_0},
592 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_READ, A_0},
593 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_READ, A_0},
594 {0, O_RDWR, DENY_READ, O_RDWR, DENY_NONE, A_0},
595 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_NONE, A_0},
596 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_NONE, A_W},
597 {0, O_RDWR, DENY_READ, O_RDWR, DENY_FCB, A_0},
598 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_FCB, A_0},
599 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_FCB, A_0},
600 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
601 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
602 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_DOS, A_0},
603 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
604 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
605 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
606 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
607 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
608 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_W},
609 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
610 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
611 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_READ, A_0},
612 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
613 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
614 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
615 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
616 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
617 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
618 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
619 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
620 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_DOS, A_0},
621 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
622 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
623 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
624 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
625 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
626 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
627 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
628 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
629 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_READ, A_W},
630 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
631 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
632 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
633 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
634 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
635 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
636 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_DOS, A_0},
637 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_DOS, A_0},
638 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_DOS, A_0},
639 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_ALL, A_0},
640 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
641 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
642 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
643 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
644 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
645 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_READ, A_0},
646 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_READ, A_0},
647 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_READ, A_0},
648 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
649 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
650 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
651 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_FCB, A_0},
652 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
653 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
654 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_DOS, A_0},
655 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
656 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_0},
657 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
658 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
659 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
660 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_RW},
661 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_R},
662 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_W},
663 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_READ, A_0},
664 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_READ, A_0},
665 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_READ, A_0},
666 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
667 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
668 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
669 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
670 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
671 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
672 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_DOS, A_0},
673 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_0},
674 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_0},
675 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
676 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
677 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
678 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
679 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
680 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
681 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_READ, A_RW},
682 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_READ, A_R},
683 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_READ, A_W},
684 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
685 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
686 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
687 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
688 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
689 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
690 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_DOS, A_0},
691 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_DOS, A_0},
692 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_DOS, A_0},
693 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_ALL, A_0},
694 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
695 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
696 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
697 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
698 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
699 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_READ, A_0},
700 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_READ, A_0},
701 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_READ, A_0},
702 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_NONE, A_0},
703 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
704 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
705 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_FCB, A_0},
706 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_FCB, A_0},
707 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_FCB, A_0},
708 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_DOS, A_0},
709 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_0},
710 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_0},
711 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
712 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
713 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
714 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
715 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
716 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
717 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
718 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
719 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
720 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
721 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
722 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
723 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_FCB, A_0},
724 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_0},
725 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_0},
726 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_DOS, A_0},
727 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_0},
728 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_0},
729 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
730 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
731 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
732 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
733 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
734 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
735 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
736 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
737 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
738 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
739 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
740 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
741 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_FCB, A_0},
742 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_0},
743 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_0}
747 static const struct {
748 int isexe;
749 int mode1, deny1;
750 int mode2, deny2;
751 enum deny_result result;
752 } denytable1[] = {
753 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
754 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
755 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
756 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_ALL, A_0},
757 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
758 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
759 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
760 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
761 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
762 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_READ, A_0},
763 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_READ, A_0},
764 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_READ, A_0},
765 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_NONE, A_RW},
766 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
767 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_NONE, A_W},
768 {1, O_RDWR, DENY_DOS, O_RDWR, DENY_FCB, A_0},
769 {1, O_RDWR, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
770 {1, O_RDWR, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
771 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
772 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
773 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
774 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
775 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
776 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
777 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_RW},
778 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_R},
779 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_W},
780 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_READ, A_0},
781 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_READ, A_0},
782 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_READ, A_0},
783 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_NONE, A_RW},
784 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
785 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_W},
786 {1, O_RDONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
787 {1, O_RDONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
788 {1, O_RDONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
789 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
790 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
791 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
792 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
793 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
794 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
795 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
796 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
797 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
798 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_READ, A_RW},
799 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_READ, A_R},
800 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_READ, A_W},
801 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_NONE, A_RW},
802 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
803 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_W},
804 {1, O_WRONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
805 {1, O_WRONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
806 {1, O_WRONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
807 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_DOS, A_0},
808 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
809 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
810 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_ALL, A_0},
811 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
812 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
813 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
814 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
815 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
816 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_READ, A_0},
817 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_READ, A_0},
818 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_READ, A_0},
819 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_NONE, A_0},
820 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
821 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
822 {1, O_RDWR, DENY_ALL, O_RDWR, DENY_FCB, A_0},
823 {1, O_RDWR, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
824 {1, O_RDWR, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
825 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
826 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
827 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
828 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
829 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
830 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
831 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
832 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
833 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
834 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
835 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
836 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
837 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
838 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
839 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
840 {1, O_RDONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
841 {1, O_RDONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
842 {1, O_RDONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
843 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
844 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
845 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
846 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
847 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
848 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
849 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
850 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
851 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
852 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
853 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
854 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
855 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
856 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
857 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
858 {1, O_WRONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
859 {1, O_WRONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
860 {1, O_WRONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
861 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
862 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
863 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
864 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
865 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
866 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
867 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
868 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
869 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
870 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_READ, A_0},
871 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
872 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
873 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
874 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
875 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
876 {1, O_RDWR, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
877 {1, O_RDWR, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
878 {1, O_RDWR, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
879 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
880 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
881 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
882 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
883 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
884 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
885 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
886 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_R},
887 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
888 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
889 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
890 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
891 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
892 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
893 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
894 {1, O_RDONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
895 {1, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
896 {1, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
897 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
898 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
899 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
900 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
901 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
902 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
903 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
904 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
905 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
906 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
907 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_R},
908 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
909 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
910 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
911 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
912 {1, O_WRONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
913 {1, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
914 {1, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
915 {1, O_RDWR, DENY_READ, O_RDWR, DENY_DOS, A_0},
916 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_DOS, A_0},
917 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_DOS, A_W},
918 {1, O_RDWR, DENY_READ, O_RDWR, DENY_ALL, A_0},
919 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_ALL, A_0},
920 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_ALL, A_0},
921 {1, O_RDWR, DENY_READ, O_RDWR, DENY_WRITE, A_0},
922 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
923 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
924 {1, O_RDWR, DENY_READ, O_RDWR, DENY_READ, A_0},
925 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_READ, A_0},
926 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_READ, A_0},
927 {1, O_RDWR, DENY_READ, O_RDWR, DENY_NONE, A_0},
928 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_NONE, A_0},
929 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_NONE, A_W},
930 {1, O_RDWR, DENY_READ, O_RDWR, DENY_FCB, A_0},
931 {1, O_RDWR, DENY_READ, O_RDONLY, DENY_FCB, A_0},
932 {1, O_RDWR, DENY_READ, O_WRONLY, DENY_FCB, A_0},
933 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
934 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
935 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_DOS, A_W},
936 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
937 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
938 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
939 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
940 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
941 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_W},
942 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
943 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
944 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_READ, A_0},
945 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
946 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
947 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
948 {1, O_RDONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
949 {1, O_RDONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
950 {1, O_RDONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
951 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
952 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
953 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_DOS, A_W},
954 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
955 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
956 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
957 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
958 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
959 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
960 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
961 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
962 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_READ, A_W},
963 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
964 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
965 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
966 {1, O_WRONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
967 {1, O_WRONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
968 {1, O_WRONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
969 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_DOS, A_RW},
970 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
971 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_DOS, A_W},
972 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_ALL, A_0},
973 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
974 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
975 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
976 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
977 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
978 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_READ, A_0},
979 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_READ, A_0},
980 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_READ, A_0},
981 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
982 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
983 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
984 {1, O_RDWR, DENY_NONE, O_RDWR, DENY_FCB, A_0},
985 {1, O_RDWR, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
986 {1, O_RDWR, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
987 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_DOS, A_RW},
988 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
989 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_W},
990 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
991 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
992 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
993 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_RW},
994 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_R},
995 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_W},
996 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_READ, A_0},
997 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_READ, A_0},
998 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_READ, A_0},
999 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
1000 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
1001 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
1002 {1, O_RDONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
1003 {1, O_RDONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
1004 {1, O_RDONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
1005 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_DOS, A_RW},
1006 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
1007 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_W},
1008 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
1009 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
1010 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
1011 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
1012 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
1013 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
1014 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_READ, A_RW},
1015 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_READ, A_R},
1016 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_READ, A_W},
1017 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
1018 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
1019 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
1020 {1, O_WRONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
1021 {1, O_WRONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
1022 {1, O_WRONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
1023 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_DOS, A_RW},
1024 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_DOS, A_R},
1025 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_DOS, A_W},
1026 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_ALL, A_0},
1027 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
1028 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
1029 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
1030 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
1031 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
1032 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_READ, A_0},
1033 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_READ, A_0},
1034 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_READ, A_0},
1035 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_NONE, A_0},
1036 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
1037 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
1038 {1, O_RDWR, DENY_FCB, O_RDWR, DENY_FCB, A_RW},
1039 {1, O_RDWR, DENY_FCB, O_RDONLY, DENY_FCB, A_RW},
1040 {1, O_RDWR, DENY_FCB, O_WRONLY, DENY_FCB, A_RW},
1041 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_DOS, A_RW},
1042 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_R},
1043 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_W},
1044 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
1045 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
1046 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
1047 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
1048 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
1049 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
1050 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
1051 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
1052 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
1053 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
1054 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
1055 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
1056 {1, O_RDONLY, DENY_FCB, O_RDWR, DENY_FCB, A_RW},
1057 {1, O_RDONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_RW},
1058 {1, O_RDONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_RW},
1059 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_DOS, A_RW},
1060 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_R},
1061 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_W},
1062 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
1063 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
1064 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
1065 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
1066 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
1067 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
1068 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
1069 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
1070 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
1071 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
1072 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
1073 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
1074 {1, O_WRONLY, DENY_FCB, O_RDWR, DENY_FCB, A_RW},
1075 {1, O_WRONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_RW},
1076 {1, O_WRONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_RW},
1077 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
1078 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
1079 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
1080 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_ALL, A_0},
1081 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
1082 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
1083 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
1084 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
1085 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
1086 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_READ, A_0},
1087 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_READ, A_0},
1088 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_READ, A_0},
1089 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_NONE, A_0},
1090 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_NONE, A_0},
1091 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_NONE, A_0},
1092 {0, O_RDWR, DENY_DOS, O_RDWR, DENY_FCB, A_RW},
1093 {0, O_RDWR, DENY_DOS, O_RDONLY, DENY_FCB, A_RW},
1094 {0, O_RDWR, DENY_DOS, O_WRONLY, DENY_FCB, A_RW},
1095 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_DOS, A_0},
1096 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
1097 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_0},
1098 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
1099 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
1100 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
1101 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
1102 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_R},
1103 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
1104 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_READ, A_0},
1105 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_READ, A_0},
1106 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_READ, A_0},
1107 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_NONE, A_0},
1108 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_R},
1109 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_0},
1110 {0, O_RDONLY, DENY_DOS, O_RDWR, DENY_FCB, A_0},
1111 {0, O_RDONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_0},
1112 {0, O_RDONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_0},
1113 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_DOS, A_RW},
1114 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_DOS, A_R},
1115 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_DOS, A_W},
1116 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_ALL, A_0},
1117 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_ALL, A_0},
1118 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_ALL, A_0},
1119 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_WRITE, A_0},
1120 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_WRITE, A_0},
1121 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_WRITE, A_0},
1122 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_READ, A_0},
1123 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_READ, A_0},
1124 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_READ, A_0},
1125 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_NONE, A_0},
1126 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_NONE, A_0},
1127 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_NONE, A_0},
1128 {0, O_WRONLY, DENY_DOS, O_RDWR, DENY_FCB, A_RW},
1129 {0, O_WRONLY, DENY_DOS, O_RDONLY, DENY_FCB, A_RW},
1130 {0, O_WRONLY, DENY_DOS, O_WRONLY, DENY_FCB, A_RW},
1131 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_DOS, A_0},
1132 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
1133 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
1134 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_ALL, A_0},
1135 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
1136 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
1137 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
1138 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
1139 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
1140 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_READ, A_0},
1141 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_READ, A_0},
1142 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_READ, A_0},
1143 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_NONE, A_0},
1144 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
1145 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
1146 {0, O_RDWR, DENY_ALL, O_RDWR, DENY_FCB, A_0},
1147 {0, O_RDWR, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
1148 {0, O_RDWR, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
1149 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
1150 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
1151 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
1152 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
1153 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
1154 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
1155 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
1156 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
1157 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
1158 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
1159 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
1160 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
1161 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
1162 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
1163 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
1164 {0, O_RDONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
1165 {0, O_RDONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
1166 {0, O_RDONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
1167 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_DOS, A_0},
1168 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_DOS, A_0},
1169 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_DOS, A_0},
1170 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_ALL, A_0},
1171 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_ALL, A_0},
1172 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_ALL, A_0},
1173 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_WRITE, A_0},
1174 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_WRITE, A_0},
1175 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_WRITE, A_0},
1176 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_READ, A_0},
1177 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_READ, A_0},
1178 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_READ, A_0},
1179 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_NONE, A_0},
1180 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_NONE, A_0},
1181 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_NONE, A_0},
1182 {0, O_WRONLY, DENY_ALL, O_RDWR, DENY_FCB, A_0},
1183 {0, O_WRONLY, DENY_ALL, O_RDONLY, DENY_FCB, A_0},
1184 {0, O_WRONLY, DENY_ALL, O_WRONLY, DENY_FCB, A_0},
1185 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
1186 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_DOS, A_0},
1187 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
1188 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
1189 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
1190 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
1191 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
1192 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
1193 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
1194 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_READ, A_0},
1195 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
1196 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
1197 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
1198 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
1199 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
1200 {0, O_RDWR, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
1201 {0, O_RDWR, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
1202 {0, O_RDWR, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
1203 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
1204 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_R},
1205 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
1206 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
1207 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
1208 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
1209 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
1210 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_R},
1211 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
1212 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
1213 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_0},
1214 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
1215 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
1216 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
1217 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
1218 {0, O_RDONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
1219 {0, O_RDONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
1220 {0, O_RDONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
1221 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_DOS, A_0},
1222 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_DOS, A_0},
1223 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_DOS, A_0},
1224 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_ALL, A_0},
1225 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_ALL, A_0},
1226 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_ALL, A_0},
1227 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_WRITE, A_0},
1228 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_WRITE, A_0},
1229 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_WRITE, A_0},
1230 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_READ, A_0},
1231 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_READ, A_R},
1232 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_READ, A_0},
1233 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_NONE, A_0},
1234 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_NONE, A_R},
1235 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_NONE, A_0},
1236 {0, O_WRONLY, DENY_WRITE, O_RDWR, DENY_FCB, A_0},
1237 {0, O_WRONLY, DENY_WRITE, O_RDONLY, DENY_FCB, A_0},
1238 {0, O_WRONLY, DENY_WRITE, O_WRONLY, DENY_FCB, A_0},
1239 {0, O_RDWR, DENY_READ, O_RDWR, DENY_DOS, A_0},
1240 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_DOS, A_0},
1241 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_DOS, A_0},
1242 {0, O_RDWR, DENY_READ, O_RDWR, DENY_ALL, A_0},
1243 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_ALL, A_0},
1244 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_ALL, A_0},
1245 {0, O_RDWR, DENY_READ, O_RDWR, DENY_WRITE, A_0},
1246 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
1247 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
1248 {0, O_RDWR, DENY_READ, O_RDWR, DENY_READ, A_0},
1249 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_READ, A_0},
1250 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_READ, A_0},
1251 {0, O_RDWR, DENY_READ, O_RDWR, DENY_NONE, A_0},
1252 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_NONE, A_0},
1253 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_NONE, A_W},
1254 {0, O_RDWR, DENY_READ, O_RDWR, DENY_FCB, A_0},
1255 {0, O_RDWR, DENY_READ, O_RDONLY, DENY_FCB, A_0},
1256 {0, O_RDWR, DENY_READ, O_WRONLY, DENY_FCB, A_0},
1257 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
1258 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
1259 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_DOS, A_0},
1260 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
1261 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
1262 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
1263 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
1264 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
1265 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_W},
1266 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
1267 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
1268 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_READ, A_0},
1269 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
1270 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
1271 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
1272 {0, O_RDONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
1273 {0, O_RDONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
1274 {0, O_RDONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
1275 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_DOS, A_0},
1276 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_DOS, A_0},
1277 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_DOS, A_0},
1278 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_ALL, A_0},
1279 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_ALL, A_0},
1280 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_ALL, A_0},
1281 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_WRITE, A_0},
1282 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_WRITE, A_0},
1283 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_WRITE, A_0},
1284 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_READ, A_0},
1285 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_READ, A_0},
1286 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_READ, A_W},
1287 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_NONE, A_0},
1288 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_NONE, A_0},
1289 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_NONE, A_W},
1290 {0, O_WRONLY, DENY_READ, O_RDWR, DENY_FCB, A_0},
1291 {0, O_WRONLY, DENY_READ, O_RDONLY, DENY_FCB, A_0},
1292 {0, O_WRONLY, DENY_READ, O_WRONLY, DENY_FCB, A_0},
1293 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_DOS, A_0},
1294 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_DOS, A_0},
1295 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_DOS, A_0},
1296 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_ALL, A_0},
1297 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
1298 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
1299 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
1300 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
1301 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
1302 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_READ, A_0},
1303 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_READ, A_0},
1304 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_READ, A_0},
1305 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
1306 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
1307 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
1308 {0, O_RDWR, DENY_NONE, O_RDWR, DENY_FCB, A_0},
1309 {0, O_RDWR, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
1310 {0, O_RDWR, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
1311 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_DOS, A_0},
1312 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_R},
1313 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_0},
1314 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
1315 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
1316 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
1317 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_RW},
1318 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_R},
1319 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_W},
1320 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_READ, A_0},
1321 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_READ, A_0},
1322 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_READ, A_0},
1323 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
1324 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
1325 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
1326 {0, O_RDONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
1327 {0, O_RDONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
1328 {0, O_RDONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
1329 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_DOS, A_0},
1330 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_DOS, A_0},
1331 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_DOS, A_0},
1332 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_ALL, A_0},
1333 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_ALL, A_0},
1334 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_ALL, A_0},
1335 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_WRITE, A_0},
1336 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_WRITE, A_0},
1337 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_WRITE, A_0},
1338 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_READ, A_RW},
1339 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_READ, A_R},
1340 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_READ, A_W},
1341 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_NONE, A_RW},
1342 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_NONE, A_R},
1343 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_NONE, A_W},
1344 {0, O_WRONLY, DENY_NONE, O_RDWR, DENY_FCB, A_0},
1345 {0, O_WRONLY, DENY_NONE, O_RDONLY, DENY_FCB, A_0},
1346 {0, O_WRONLY, DENY_NONE, O_WRONLY, DENY_FCB, A_0},
1347 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_DOS, A_RW},
1348 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_DOS, A_R},
1349 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_DOS, A_W},
1350 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_ALL, A_0},
1351 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
1352 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
1353 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
1354 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
1355 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
1356 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_READ, A_0},
1357 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_READ, A_0},
1358 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_READ, A_0},
1359 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_NONE, A_0},
1360 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
1361 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
1362 {0, O_RDWR, DENY_FCB, O_RDWR, DENY_FCB, A_RW},
1363 {0, O_RDWR, DENY_FCB, O_RDONLY, DENY_FCB, A_RW},
1364 {0, O_RDWR, DENY_FCB, O_WRONLY, DENY_FCB, A_RW},
1365 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_DOS, A_RW},
1366 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_R},
1367 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_W},
1368 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
1369 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
1370 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
1371 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
1372 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
1373 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
1374 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
1375 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
1376 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
1377 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
1378 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
1379 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
1380 {0, O_RDONLY, DENY_FCB, O_RDWR, DENY_FCB, A_RW},
1381 {0, O_RDONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_RW},
1382 {0, O_RDONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_RW},
1383 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_DOS, A_RW},
1384 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_DOS, A_R},
1385 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_DOS, A_W},
1386 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_ALL, A_0},
1387 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_ALL, A_0},
1388 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_ALL, A_0},
1389 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_WRITE, A_0},
1390 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_WRITE, A_0},
1391 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_WRITE, A_0},
1392 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_READ, A_0},
1393 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_READ, A_0},
1394 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_READ, A_0},
1395 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_NONE, A_0},
1396 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_NONE, A_0},
1397 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_NONE, A_0},
1398 {0, O_WRONLY, DENY_FCB, O_RDWR, DENY_FCB, A_RW},
1399 {0, O_WRONLY, DENY_FCB, O_RDONLY, DENY_FCB, A_RW},
1400 {0, O_WRONLY, DENY_FCB, O_WRONLY, DENY_FCB, A_RW}
1404 static void progress_bar(uint_t i, uint_t total)
1406 printf("%5d/%5d\r", i, total);
1407 fflush(stdout);
1411 this produces a matrix of deny mode behaviour for 1 connection
1413 BOOL torture_denytest1(struct torture_context *torture)
1415 static struct smbcli_state *cli1;
1416 int fnum1, fnum2;
1417 int i;
1418 BOOL correct = True;
1419 struct timeval tv, tv_start;
1420 const char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"};
1421 int failures=0;
1423 if (!torture_open_connection(&cli1)) {
1424 return False;
1427 printf("starting denytest1\n");
1429 printf("Testing deny modes with 1 connection\n");
1431 for (i=0;i<2;i++) {
1432 smbcli_unlink(cli1->tree, fnames[i]);
1433 fnum1 = smbcli_open(cli1->tree, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
1434 smbcli_write(cli1->tree, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
1435 smbcli_close(cli1->tree, fnum1);
1438 printf("testing %d entries\n", (int)ARRAY_SIZE(denytable1));
1440 GetTimeOfDay(&tv_start);
1442 for (i=0; i<ARRAY_SIZE(denytable1); i++) {
1443 enum deny_result res;
1444 const char *fname = fnames[denytable1[i].isexe];
1446 progress_bar(i, ARRAY_SIZE(denytable1));
1448 fnum1 = smbcli_open(cli1->tree, fname,
1449 denytable1[i].mode1,
1450 denytable1[i].deny1);
1451 fnum2 = smbcli_open(cli1->tree, fname,
1452 denytable1[i].mode2,
1453 denytable1[i].deny2);
1455 if (fnum1 == -1) {
1456 res = A_X;
1457 } else if (fnum2 == -1) {
1458 res = A_0;
1459 } else {
1460 uint8_t x = 1;
1461 res = A_0;
1462 if (smbcli_read(cli1->tree, fnum2, &x, 0, 1) == 1) {
1463 res += A_R;
1465 if (smbcli_write(cli1->tree, fnum2, 0, &x, 0, 1) == 1) {
1466 res += A_W;
1470 if (torture_showall || res != denytable1[i].result) {
1471 int64_t tdif;
1472 GetTimeOfDay(&tv);
1473 tdif = usec_time_diff(&tv, &tv_start);
1474 tdif /= 1000;
1475 printf("%lld: %s %8s %10s %8s %10s %s (correct=%s)\n",
1476 (long long)tdif,
1477 fname,
1478 denystr(denytable1[i].deny1),
1479 openstr(denytable1[i].mode1),
1480 denystr(denytable1[i].deny2),
1481 openstr(denytable1[i].mode2),
1482 resultstr(res),
1483 resultstr(denytable1[i].result));
1486 if (res != denytable1[i].result) {
1487 correct = False;
1488 CHECK_MAX_FAILURES(failed);
1491 smbcli_close(cli1->tree, fnum1);
1492 smbcli_close(cli1->tree, fnum2);
1495 failed:
1496 for (i=0;i<2;i++) {
1497 smbcli_unlink(cli1->tree, fnames[i]);
1500 if (!torture_close_connection(cli1)) {
1501 correct = False;
1504 printf("finshed denytest1 (%d failures)\n", failures);
1505 return correct;
1510 this produces a matrix of deny mode behaviour with 2 connections
1512 BOOL torture_denytest2(struct torture_context *torture)
1514 static struct smbcli_state *cli1, *cli2;
1515 int fnum1, fnum2;
1516 int i;
1517 BOOL correct = True;
1518 const char *fnames[2] = {"\\denytest2.dat", "\\denytest2.exe"};
1519 struct timeval tv, tv_start;
1520 int failures=0;
1522 if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
1523 return False;
1526 printf("starting denytest2\n");
1528 printf("Testing deny modes with 2 connections\n");
1530 for (i=0;i<2;i++) {
1531 smbcli_unlink(cli1->tree, fnames[i]);
1532 fnum1 = smbcli_open(cli1->tree, fnames[i], O_RDWR|O_CREAT, DENY_NONE);
1533 smbcli_write(cli1->tree, fnum1, 0, fnames[i], 0, strlen(fnames[i]));
1534 smbcli_close(cli1->tree, fnum1);
1537 GetTimeOfDay(&tv_start);
1539 for (i=0; i<ARRAY_SIZE(denytable2); i++) {
1540 enum deny_result res;
1541 const char *fname = fnames[denytable2[i].isexe];
1543 progress_bar(i, ARRAY_SIZE(denytable1));
1545 fnum1 = smbcli_open(cli1->tree, fname,
1546 denytable2[i].mode1,
1547 denytable2[i].deny1);
1548 fnum2 = smbcli_open(cli2->tree, fname,
1549 denytable2[i].mode2,
1550 denytable2[i].deny2);
1552 if (fnum1 == -1) {
1553 res = A_X;
1554 } else if (fnum2 == -1) {
1555 res = A_0;
1556 } else {
1557 uint8_t x = 1;
1558 res = A_0;
1559 if (smbcli_read(cli2->tree, fnum2, &x, 0, 1) == 1) {
1560 res += A_R;
1562 if (smbcli_write(cli2->tree, fnum2, 0, &x, 0, 1) == 1) {
1563 res += A_W;
1567 if (torture_showall || res != denytable2[i].result) {
1568 int64_t tdif;
1569 GetTimeOfDay(&tv);
1570 tdif = usec_time_diff(&tv, &tv_start);
1571 tdif /= 1000;
1572 printf("%lld: %s %8s %10s %8s %10s %s (correct=%s)\n",
1573 (long long)tdif,
1574 fname,
1575 denystr(denytable2[i].deny1),
1576 openstr(denytable2[i].mode1),
1577 denystr(denytable2[i].deny2),
1578 openstr(denytable2[i].mode2),
1579 resultstr(res),
1580 resultstr(denytable2[i].result));
1583 if (res != denytable2[i].result) {
1584 correct = False;
1585 CHECK_MAX_FAILURES(failed);
1588 smbcli_close(cli1->tree, fnum1);
1589 smbcli_close(cli2->tree, fnum2);
1592 failed:
1593 for (i=0;i<2;i++) {
1594 smbcli_unlink(cli1->tree, fnames[i]);
1597 if (!torture_close_connection(cli1)) {
1598 correct = False;
1600 if (!torture_close_connection(cli2)) {
1601 correct = False;
1604 printf("finshed denytest2 (%d failures)\n", failures);
1605 return correct;
1611 simple test harness for playing with deny modes
1613 BOOL torture_denytest3(struct torture_context *torture)
1615 struct smbcli_state *cli1, *cli2;
1616 int fnum1, fnum2;
1617 const char *fname;
1619 printf("starting deny3 test\n");
1621 printf("Testing simple deny modes\n");
1623 if (!torture_open_connection(&cli1)) {
1624 return False;
1626 if (!torture_open_connection(&cli2)) {
1627 return False;
1630 fname = "\\deny_dos1.dat";
1632 smbcli_unlink(cli1->tree, fname);
1633 fnum1 = smbcli_open(cli1->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS);
1634 fnum2 = smbcli_open(cli1->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS);
1635 if (fnum1 != -1) smbcli_close(cli1->tree, fnum1);
1636 if (fnum2 != -1) smbcli_close(cli1->tree, fnum2);
1637 smbcli_unlink(cli1->tree, fname);
1638 printf("fnum1=%d fnum2=%d\n", fnum1, fnum2);
1641 fname = "\\deny_dos2.dat";
1643 smbcli_unlink(cli1->tree, fname);
1644 fnum1 = smbcli_open(cli1->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS);
1645 fnum2 = smbcli_open(cli2->tree, fname, O_CREAT|O_TRUNC|O_WRONLY, DENY_DOS);
1646 if (fnum1 != -1) smbcli_close(cli1->tree, fnum1);
1647 if (fnum2 != -1) smbcli_close(cli2->tree, fnum2);
1648 smbcli_unlink(cli1->tree, fname);
1649 printf("fnum1=%d fnum2=%d\n", fnum1, fnum2);
1652 torture_close_connection(cli1);
1653 torture_close_connection(cli2);
1655 return True;
1658 struct bit_value {
1659 uint32_t value;
1660 const char *name;
1663 static uint32_t map_bits(const struct bit_value *bv, int b, int nbits)
1665 int i;
1666 uint32_t ret = 0;
1667 for (i=0;i<nbits;i++) {
1668 if (b & (1<<i)) {
1669 ret |= bv[i].value;
1672 return ret;
1675 static const char *bit_string(TALLOC_CTX *mem_ctx, const struct bit_value *bv, int b, int nbits)
1677 char *ret = NULL;
1678 int i;
1679 for (i=0;i<nbits;i++) {
1680 if (b & (1<<i)) {
1681 if (ret == NULL) {
1682 ret = talloc_asprintf(mem_ctx, "%s", bv[i].name);
1683 } else {
1684 ret = talloc_asprintf_append(ret, " | %s", bv[i].name);
1688 if (ret == NULL) ret = talloc_strdup(mem_ctx, "(NONE)");
1689 return ret;
1694 determine if two opens conflict
1696 static NTSTATUS predict_share_conflict(uint32_t sa1, uint32_t am1, uint32_t sa2, uint32_t am2,
1697 BOOL read_for_execute, enum deny_result *res)
1699 #define CHECK_MASK(am, sa, right, share) do { \
1700 if (((am) & (right)) && !((sa) & (share))) { \
1701 *res = A_0; \
1702 return NT_STATUS_SHARING_VIOLATION; \
1703 }} while (0)
1705 *res = A_0;
1706 if (am2 & (SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA)) {
1707 *res += A_W;
1709 if (am2 & SEC_FILE_READ_DATA) {
1710 *res += A_R;
1711 } else if ((am2 & SEC_FILE_EXECUTE) && read_for_execute) {
1712 *res += A_R;
1715 /* if either open involves no read.write or delete access then
1716 it can't conflict */
1717 if (!(am1 & (SEC_FILE_WRITE_DATA |
1718 SEC_FILE_APPEND_DATA |
1719 SEC_FILE_READ_DATA |
1720 SEC_FILE_EXECUTE |
1721 SEC_STD_DELETE))) {
1722 return NT_STATUS_OK;
1724 if (!(am2 & (SEC_FILE_WRITE_DATA |
1725 SEC_FILE_APPEND_DATA |
1726 SEC_FILE_READ_DATA |
1727 SEC_FILE_EXECUTE |
1728 SEC_STD_DELETE))) {
1729 return NT_STATUS_OK;
1732 /* check the basic share access */
1733 CHECK_MASK(am1, sa2,
1734 SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA,
1735 NTCREATEX_SHARE_ACCESS_WRITE);
1736 CHECK_MASK(am2, sa1,
1737 SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA,
1738 NTCREATEX_SHARE_ACCESS_WRITE);
1740 CHECK_MASK(am1, sa2,
1741 SEC_FILE_READ_DATA | SEC_FILE_EXECUTE,
1742 NTCREATEX_SHARE_ACCESS_READ);
1743 CHECK_MASK(am2, sa1,
1744 SEC_FILE_READ_DATA | SEC_FILE_EXECUTE,
1745 NTCREATEX_SHARE_ACCESS_READ);
1747 CHECK_MASK(am1, sa2,
1748 SEC_STD_DELETE,
1749 NTCREATEX_SHARE_ACCESS_DELETE);
1750 CHECK_MASK(am2, sa1,
1751 SEC_STD_DELETE,
1752 NTCREATEX_SHARE_ACCESS_DELETE);
1754 return NT_STATUS_OK;
1758 a denytest for ntcreatex
1760 static BOOL torture_ntdenytest(struct smbcli_state *cli1, struct smbcli_state *cli2, int client)
1762 const struct bit_value share_access_bits[] = {
1763 { NTCREATEX_SHARE_ACCESS_READ, "S_R" },
1764 { NTCREATEX_SHARE_ACCESS_WRITE, "S_W" },
1765 { NTCREATEX_SHARE_ACCESS_DELETE, "S_D" }
1767 const struct bit_value access_mask_bits[] = {
1768 { SEC_FILE_READ_DATA, "R_DATA" },
1769 { SEC_FILE_WRITE_DATA, "W_DATA" },
1770 { SEC_FILE_READ_ATTRIBUTE, "R_ATTR" },
1771 { SEC_FILE_WRITE_ATTRIBUTE, "W_ATTR" },
1772 { SEC_FILE_READ_EA, "R_EAS " },
1773 { SEC_FILE_WRITE_EA, "W_EAS " },
1774 { SEC_FILE_APPEND_DATA, "A_DATA" },
1775 { SEC_FILE_EXECUTE, "EXEC " }
1777 int fnum1;
1778 int i;
1779 BOOL correct = True;
1780 struct timeval tv, tv_start;
1781 const char *fname;
1782 int nbits1 = ARRAY_SIZE(share_access_bits);
1783 int nbits2 = ARRAY_SIZE(access_mask_bits);
1784 union smb_open io1, io2;
1785 extern int torture_numops;
1786 int failures = 0;
1787 uint8_t buf[1];
1789 printf("format: server correct\n");
1791 ZERO_STRUCT(buf);
1793 fname = talloc_asprintf(cli1, "\\ntdeny_%d.dll", client);
1795 smbcli_unlink(cli1->tree, fname);
1796 fnum1 = smbcli_open(cli1->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
1797 smbcli_write(cli1->tree, fnum1, 0, buf, 0, sizeof(buf));
1798 smbcli_close(cli1->tree, fnum1);
1800 GetTimeOfDay(&tv_start);
1802 io1.ntcreatex.level = RAW_OPEN_NTCREATEX;
1803 io1.ntcreatex.in.root_fid = 0;
1804 io1.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED;
1805 io1.ntcreatex.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE;
1806 io1.ntcreatex.in.file_attr = 0;
1807 io1.ntcreatex.in.alloc_size = 0;
1808 io1.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
1809 io1.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_IMPERSONATION;
1810 io1.ntcreatex.in.security_flags = 0;
1811 io1.ntcreatex.in.fname = fname;
1812 io2 = io1;
1814 printf("testing %d entries on %s\n", torture_numops, fname);
1816 for (i=0;i<torture_numops;i++) {
1817 NTSTATUS status1, status2, status2_p;
1818 int64_t tdif;
1819 TALLOC_CTX *mem_ctx = talloc_new(NULL);
1820 enum deny_result res, res2;
1821 int b_sa1 = random() & ((1<<nbits1)-1);
1822 int b_am1 = random() & ((1<<nbits2)-1);
1823 int b_sa2 = random() & ((1<<nbits1)-1);
1824 int b_am2 = random() & ((1<<nbits2)-1);
1825 BOOL read_for_execute;
1827 progress_bar(i, torture_numops);
1829 io1.ntcreatex.in.share_access = map_bits(share_access_bits, b_sa1, nbits1);
1830 io1.ntcreatex.in.access_mask = map_bits(access_mask_bits, b_am1, nbits2);
1832 io2.ntcreatex.in.share_access = map_bits(share_access_bits, b_sa2, nbits1);
1833 io2.ntcreatex.in.access_mask = map_bits(access_mask_bits, b_am2, nbits2);
1835 status1 = smb_raw_open(cli1->tree, mem_ctx, &io1);
1836 status2 = smb_raw_open(cli2->tree, mem_ctx, &io2);
1838 if (random() % 2 == 0) {
1839 read_for_execute = True;
1840 } else {
1841 read_for_execute = False;
1844 if (!NT_STATUS_IS_OK(status1)) {
1845 res = A_X;
1846 } else if (!NT_STATUS_IS_OK(status2)) {
1847 res = A_0;
1848 } else {
1849 union smb_read r;
1850 NTSTATUS status;
1852 /* we can't use smbcli_read() as we need to
1853 set read_for_execute */
1854 r.readx.level = RAW_READ_READX;
1855 r.readx.in.file.fnum = io2.ntcreatex.out.file.fnum;
1856 r.readx.in.offset = 0;
1857 r.readx.in.mincnt = sizeof(buf);
1858 r.readx.in.maxcnt = sizeof(buf);
1859 r.readx.in.remaining = 0;
1860 r.readx.in.read_for_execute = read_for_execute;
1861 r.readx.out.data = buf;
1863 res = A_0;
1864 status = smb_raw_read(cli2->tree, &r);
1865 if (NT_STATUS_IS_OK(status)) {
1866 res += A_R;
1868 if (smbcli_write(cli2->tree, io2.ntcreatex.out.file.fnum,
1869 0, buf, 0, sizeof(buf)) >= 1) {
1870 res += A_W;
1874 if (NT_STATUS_IS_OK(status1)) {
1875 smbcli_close(cli1->tree, io1.ntcreatex.out.file.fnum);
1877 if (NT_STATUS_IS_OK(status2)) {
1878 smbcli_close(cli2->tree, io2.ntcreatex.out.file.fnum);
1881 status2_p = predict_share_conflict(io1.ntcreatex.in.share_access,
1882 io1.ntcreatex.in.access_mask,
1883 io2.ntcreatex.in.share_access,
1884 io2.ntcreatex.in.access_mask,
1885 read_for_execute,
1886 &res2);
1888 GetTimeOfDay(&tv);
1889 tdif = usec_time_diff(&tv, &tv_start);
1890 tdif /= 1000;
1891 if (torture_showall ||
1892 !NT_STATUS_EQUAL(status2, status2_p) ||
1893 res != res2) {
1894 printf("\n%-20s %-70s\n%-20s %-70s %4s %4s %s/%s\n",
1895 bit_string(mem_ctx, share_access_bits, b_sa1, nbits1),
1896 bit_string(mem_ctx, access_mask_bits, b_am1, nbits2),
1897 bit_string(mem_ctx, share_access_bits, b_sa2, nbits1),
1898 bit_string(mem_ctx, access_mask_bits, b_am2, nbits2),
1899 resultstr(res),
1900 resultstr(res2),
1901 nt_errstr(status2),
1902 nt_errstr(status2_p));
1903 fflush(stdout);
1906 if (res != res2 ||
1907 !NT_STATUS_EQUAL(status2, status2_p)) {
1908 CHECK_MAX_FAILURES(failed);
1909 correct = False;
1912 talloc_free(mem_ctx);
1915 failed:
1916 smbcli_unlink(cli1->tree, fname);
1918 printf("finshed ntdenytest (%d failures)\n", failures);
1919 return correct;
1925 a denytest for ntcreatex
1927 BOOL torture_ntdenytest1(struct smbcli_state *cli, int client)
1929 extern int torture_seed;
1931 srandom(torture_seed + client);
1933 printf("starting ntdenytest1 client %d\n", client);
1935 return torture_ntdenytest(cli, cli, client);
1939 a denytest for ntcreatex
1941 BOOL torture_ntdenytest2(struct torture_context *torture)
1943 struct smbcli_state *cli1, *cli2;
1944 BOOL ret;
1946 if (!torture_open_connection(&cli1)) {
1947 return False;
1950 if (!torture_open_connection(&cli2)) {
1951 return False;
1954 printf("starting ntdenytest2\n");
1956 ret = torture_ntdenytest(cli1, cli2, 0);
1958 torture_close_connection(cli1);
1959 torture_close_connection(cli2);
1961 return ret;
1965 #define CHECK_STATUS(status, correct) do { \
1966 if (!NT_STATUS_EQUAL(status, correct)) { \
1967 printf("(%s) Incorrect status %s - should be %s\n", \
1968 __location__, nt_errstr(status), nt_errstr(correct)); \
1969 ret = False; \
1970 goto done; \
1971 }} while (0)
1973 #define CHECK_VAL(v, correct) do { \
1974 if ((v) != (correct)) { \
1975 printf("(%s) wrong value for %s 0x%x - should be 0x%x\n", \
1976 __location__, #v, (int)(v), (int)correct); \
1977 ret = False; \
1978 }} while (0)
1981 test sharing of handles with DENY_DOS on a single connection
1983 BOOL torture_denydos_sharing(struct torture_context *torture)
1985 struct smbcli_state *cli;
1986 union smb_open io;
1987 union smb_fileinfo finfo;
1988 const char *fname = "\\torture_denydos.txt";
1989 NTSTATUS status;
1990 int fnum1 = -1, fnum2 = -1;
1991 BOOL ret = True;
1992 union smb_setfileinfo sfinfo;
1993 TALLOC_CTX *mem_ctx;
1995 if (!torture_open_connection(&cli)) {
1996 return False;
1999 mem_ctx = talloc_new(cli);
2001 printf("Checking DENY_DOS shared handle semantics\n");
2002 smbcli_unlink(cli->tree, fname);
2004 io.openx.level = RAW_OPEN_OPENX;
2005 io.openx.in.fname = fname;
2006 io.openx.in.flags = OPENX_FLAGS_ADDITIONAL_INFO;
2007 io.openx.in.open_mode = OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_DOS;
2008 io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE;
2009 io.openx.in.search_attrs = 0;
2010 io.openx.in.file_attrs = 0;
2011 io.openx.in.write_time = 0;
2012 io.openx.in.size = 0;
2013 io.openx.in.timeout = 0;
2015 printf("openx twice with RDWR/DENY_DOS\n");
2016 status = smb_raw_open(cli->tree, mem_ctx, &io);
2017 CHECK_STATUS(status, NT_STATUS_OK);
2018 fnum1 = io.openx.out.file.fnum;
2020 status = smb_raw_open(cli->tree, mem_ctx, &io);
2021 CHECK_STATUS(status, NT_STATUS_OK);
2022 fnum2 = io.openx.out.file.fnum;
2024 printf("fnum1=%d fnum2=%d\n", fnum1, fnum2);
2026 sfinfo.generic.level = RAW_SFILEINFO_POSITION_INFORMATION;
2027 sfinfo.position_information.in.file.fnum = fnum1;
2028 sfinfo.position_information.in.position = 1000;
2029 status = smb_raw_setfileinfo(cli->tree, &sfinfo);
2030 CHECK_STATUS(status, NT_STATUS_OK);
2032 printf("two handles should be same file handle\n");
2033 finfo.position_information.level = RAW_FILEINFO_POSITION_INFORMATION;
2034 finfo.position_information.in.file.fnum = fnum1;
2035 status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
2036 CHECK_STATUS(status, NT_STATUS_OK);
2037 CHECK_VAL(finfo.position_information.out.position, 1000);
2039 finfo.position_information.in.file.fnum = fnum2;
2040 status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
2041 CHECK_STATUS(status, NT_STATUS_OK);
2042 CHECK_VAL(finfo.position_information.out.position, 1000);
2045 smbcli_close(cli->tree, fnum1);
2046 smbcli_close(cli->tree, fnum2);
2048 printf("openx twice with RDWR/DENY_NONE\n");
2049 io.openx.in.open_mode = OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_NONE;
2050 status = smb_raw_open(cli->tree, mem_ctx, &io);
2051 CHECK_STATUS(status, NT_STATUS_OK);
2052 fnum1 = io.openx.out.file.fnum;
2054 io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN;
2055 status = smb_raw_open(cli->tree, mem_ctx, &io);
2056 CHECK_STATUS(status, NT_STATUS_OK);
2057 fnum2 = io.openx.out.file.fnum;
2059 printf("fnum1=%d fnum2=%d\n", fnum1, fnum2);
2061 printf("two handles should be separate\n");
2062 sfinfo.generic.level = RAW_SFILEINFO_POSITION_INFORMATION;
2063 sfinfo.position_information.in.file.fnum = fnum1;
2064 sfinfo.position_information.in.position = 1000;
2065 status = smb_raw_setfileinfo(cli->tree, &sfinfo);
2066 CHECK_STATUS(status, NT_STATUS_OK);
2068 finfo.position_information.level = RAW_FILEINFO_POSITION_INFORMATION;
2069 finfo.position_information.in.file.fnum = fnum1;
2070 status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
2071 CHECK_STATUS(status, NT_STATUS_OK);
2072 CHECK_VAL(finfo.position_information.out.position, 1000);
2074 finfo.position_information.in.file.fnum = fnum2;
2075 status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo);
2076 CHECK_STATUS(status, NT_STATUS_OK);
2077 CHECK_VAL(finfo.position_information.out.position, 0);
2079 done:
2080 smbcli_close(cli->tree, fnum1);
2081 smbcli_close(cli->tree, fnum2);
2082 smbcli_unlink(cli->tree, fname);
2084 return ret;