1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14 
15 #ifndef _WIN32
16 
17 
18 #include <OSD_Directory.hxx>
19 #include <OSD_File.hxx>
20 #include <OSD_FileNode.hxx>
21 #include <OSD_Protection.hxx>
22 #include <OSD_WhoAmI.hxx>
23 
24 #include <sys/stat.h>
25 // Ci-joint le tableau de gestion des protection (Ajout et Retrait). Les
26 // tableaux sont des tableaux a deux dimensions, indices par l'enumeration
27 // OSD_SingleProtection. Il y a en tout 16 possibilites dans l enumeration.
28 // Voir JPT pour tous renseignements....
29 static OSD_SingleProtection TabProtAdd [16][16] =
30 {
31 {OSD_None,OSD_R,OSD_W,OSD_RW,OSD_X,OSD_RX,OSD_WX,OSD_RWX,OSD_D,OSD_RD,OSD_WD,OSD_RWD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD},
32 
33 {OSD_R,OSD_R,OSD_RW,OSD_RW,OSD_RX,OSD_RX,OSD_RWX,OSD_RWX,OSD_RD,OSD_RD,OSD_RWD,OSD_RWD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD},
34 
35 {OSD_W,OSD_RW,OSD_W,OSD_RW,OSD_WX,OSD_RWX,OSD_WX,OSD_RWX,OSD_WD,OSD_RWD,OSD_WD,OSD_RWD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD},
36 
37 {OSD_RW,OSD_RW,OSD_RW,OSD_RW,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD},
38 
39 {OSD_X,OSD_RX,OSD_WX,OSD_RWX,OSD_X,OSD_RX,OSD_WX,OSD_RWX,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD},
40 
41 {OSD_RX,OSD_RX,OSD_RWX,OSD_RWX,OSD_RX,OSD_RX,OSD_RWX,OSD_RWX,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD},
42 
43 {OSD_WX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_WX,OSD_RWX,OSD_WX,OSD_RWX,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD},
44 
45 {OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWX,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD},
46 
47 {OSD_D,OSD_RD,OSD_WD,OSD_RWD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD,OSD_D,OSD_RD,OSD_WD,OSD_RWD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD},
48 
49 {OSD_RD,OSD_RD,OSD_RWD,OSD_RWD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD,OSD_RD,OSD_RD,OSD_RWD,OSD_RWD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD},
50 
51 {OSD_WD,OSD_RWD,OSD_WD,OSD_RWD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WD,OSD_RWD,OSD_WD,OSD_RWD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD},
52 
53 {OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD},
54 
55 {OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD,OSD_XD,OSD_RXD,OSD_WXD,OSD_RWXD},
56 
57 {OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD,OSD_RXD,OSD_RXD,OSD_RWXD,OSD_RWXD},
58 
59 {OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD,OSD_WXD,OSD_RWXD},
60 
61 {OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD,OSD_RWXD}
62 
63 };
64 
65 // -----------------------
66 
67 static OSD_SingleProtection TabProtSub [16][16] =
68 {
69 {OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None},
70 
71 {OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None},
72 
73 {OSD_W,OSD_W,OSD_None,OSD_None,OSD_W,OSD_W,OSD_None,OSD_None,OSD_W,OSD_W,OSD_None,OSD_None,OSD_W,OSD_W,OSD_None,OSD_None},
74 
75 {OSD_RW,OSD_W,OSD_R,OSD_None,OSD_RW,OSD_W,OSD_R,OSD_None,OSD_RW,OSD_W,OSD_R,OSD_None,OSD_RW,OSD_W,OSD_R,OSD_None},
76 
77 {OSD_X,OSD_X,OSD_X,OSD_None,OSD_None,OSD_None,OSD_None,OSD_X,OSD_X,OSD_X,OSD_X,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None},
78 
79 {OSD_RX,OSD_X,OSD_RX,OSD_X,OSD_R,OSD_None,OSD_R,OSD_None,OSD_RX,OSD_X,OSD_RX,OSD_X,OSD_R,OSD_None,OSD_R,OSD_None},
80 
81 {OSD_WX,OSD_WX,OSD_X,OSD_X,OSD_W,OSD_W,OSD_None,OSD_None,OSD_WX,OSD_WX,OSD_X,OSD_X,OSD_W,OSD_W,OSD_None,OSD_None},
82 
83 {OSD_RWX,OSD_WX,OSD_RX,OSD_X,OSD_RW,OSD_W,OSD_R,OSD_None,OSD_RWX,OSD_WX,OSD_RX,OSD_X,OSD_RW,OSD_W,OSD_R,OSD_None},
84 
85 {OSD_D,OSD_D,OSD_D,OSD_D,OSD_D,OSD_D,OSD_D,OSD_D,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None,OSD_None},
86 
87 {OSD_RD,OSD_D,OSD_RD,OSD_D,OSD_RD,OSD_D,OSD_RD,OSD_D,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None,OSD_R,OSD_None},
88 
89 {OSD_WD,OSD_WD,OSD_D,OSD_D,OSD_WD,OSD_WD,OSD_D,OSD_D,OSD_W,OSD_W,OSD_None,OSD_None,OSD_W,OSD_W,OSD_None,OSD_None},
90 
91 {OSD_RWD,OSD_WD,OSD_RD,OSD_D,OSD_RWD,OSD_WD,OSD_RD,OSD_D,OSD_RW,OSD_W,OSD_R,OSD_None,OSD_RW,OSD_W,OSD_R,OSD_None},
92 
93 {OSD_XD,OSD_XD,OSD_XD,OSD_XD,OSD_D,OSD_D,OSD_D,OSD_D,OSD_X,OSD_X,OSD_X,OSD_X,OSD_None,OSD_None,OSD_None,OSD_None},
94 
95 {OSD_RXD,OSD_XD,OSD_RXD,OSD_XD,OSD_RD,OSD_D,OSD_RD,OSD_D,OSD_RX,OSD_X,OSD_RX,OSD_X,OSD_R,OSD_None,OSD_R,OSD_None},
96 
97 {OSD_WXD,OSD_WXD,OSD_XD,OSD_XD,OSD_WD,OSD_WD,OSD_D,OSD_D,OSD_WX,OSD_WX,OSD_X,OSD_X,OSD_W,OSD_W,OSD_None,OSD_None},
98 
99 {OSD_RWXD,OSD_WXD,OSD_RXD,OSD_XD,OSD_RWD,OSD_WD,OSD_RD,OSD_D,OSD_RWX,OSD_WX,OSD_RX,OSD_X,OSD_RW,OSD_W,OSD_R,OSD_None}
100 
101 };
102 //const OSD_WhoAmI Iam = OSD_WProtection;
103 
104 
105 // Initialize System, Group, World for read only and User for read & write
106 
OSD_Protection()107 OSD_Protection::OSD_Protection(){
108  s = OSD_R;
109  u = OSD_RWD;
110  g = OSD_R;
111  w = OSD_R;
112 }
113 
OSD_Protection(const OSD_SingleProtection System,const OSD_SingleProtection User,const OSD_SingleProtection Group,const OSD_SingleProtection World)114 OSD_Protection::OSD_Protection(const OSD_SingleProtection System,
115                                      const OSD_SingleProtection User,
116                                      const OSD_SingleProtection Group,
117                                      const OSD_SingleProtection World){
118 
119  s = System;
120  u = User;
121  g = Group;
122  w = World;
123 }
124 
Values(OSD_SingleProtection & System,OSD_SingleProtection & User,OSD_SingleProtection & Group,OSD_SingleProtection & World)125 void  OSD_Protection::Values(OSD_SingleProtection& System,
126                              OSD_SingleProtection& User,
127                              OSD_SingleProtection& Group,
128                              OSD_SingleProtection& World){
129  System = s;
130  User = u;
131  Group = g;
132  World = w;
133 }
134 
135 
SetValues(const OSD_SingleProtection System,const OSD_SingleProtection User,const OSD_SingleProtection Group,const OSD_SingleProtection World)136 void  OSD_Protection::SetValues(const OSD_SingleProtection System,
137                                 const OSD_SingleProtection User,
138                                 const OSD_SingleProtection Group,
139                                 const OSD_SingleProtection World){
140 
141  s = System;
142  u = User;
143  g = Group;
144  w = World;
145 }
146 
147 
SetSystem(const OSD_SingleProtection priv)148 void OSD_Protection::SetSystem (const OSD_SingleProtection priv){
149  s = priv;
150 }
151 
SetUser(const OSD_SingleProtection priv)152 void OSD_Protection::SetUser (const OSD_SingleProtection priv){
153  u = priv;
154 }
155 
SetGroup(const OSD_SingleProtection priv)156 void OSD_Protection::SetGroup (const OSD_SingleProtection priv){
157  g = priv;
158 }
159 
SetWorld(const OSD_SingleProtection priv)160 void OSD_Protection::SetWorld (const OSD_SingleProtection priv){
161  w = priv;
162 }
163 
164 
System() const165 OSD_SingleProtection OSD_Protection::System()const{
166  return(s);
167 }
168 
User() const169 OSD_SingleProtection OSD_Protection::User()const{
170  return(u);
171 }
172 
Group() const173 OSD_SingleProtection OSD_Protection::Group()const{
174  return(g);
175 }
176 
World() const177 OSD_SingleProtection OSD_Protection::World()const{
178  return(w);
179 }
180 
181 
Add(OSD_SingleProtection & aProtection,const OSD_SingleProtection aRight)182 void OSD_Protection::Add(OSD_SingleProtection& aProtection,
183                          const OSD_SingleProtection aRight){
184  aProtection = TabProtAdd[aProtection][aRight];
185 }
186 
187 
Sub(OSD_SingleProtection & aProtection,const OSD_SingleProtection aRight)188 void OSD_Protection::Sub(OSD_SingleProtection& aProtection,
189                          const OSD_SingleProtection aRight){
190  aProtection = TabProtSub[aProtection][aRight];
191 }
192 
193 
194 /* Get internal UNIX's access rights for user, group and other */
195 
Internal() const196 Standard_Integer  OSD_Protection::Internal()const{
197 
198 Standard_Integer internal_prot = 0;
199 
200  if (u & OSD_R) internal_prot |= S_IRUSR;
201  if (u & OSD_W) internal_prot |= S_IWUSR;
202  if (u & OSD_D) internal_prot |= S_IWUSR;
203  if (u & OSD_X) internal_prot |= S_IXUSR;
204 
205  if (g & OSD_R) internal_prot |= S_IRGRP;
206  if (g & OSD_W) internal_prot |= S_IWGRP;
207  if (g & OSD_D) internal_prot |= S_IWGRP;
208  if (g & OSD_X) internal_prot |= S_IXGRP;
209 
210  if (w & OSD_R) internal_prot |= S_IROTH;
211  if (w & OSD_W) internal_prot |= S_IWOTH;
212  if (w & OSD_D) internal_prot |= S_IWOTH;
213  if (w & OSD_X) internal_prot |= S_IXOTH;
214 
215  if (s & OSD_R) internal_prot |= S_IROTH;
216  if (s & OSD_W) internal_prot |= S_IWOTH;
217  if (s & OSD_D) internal_prot |= S_IWOTH;
218  if (s & OSD_X) internal_prot |= S_IXOTH;
219 
220  return ( internal_prot );
221 }
222 
223 
224 #else
225 
226 //------------------------------------------------------------------------
227 //-------------------  WNT Sources of OSD_Protection ---------------------
228 //------------------------------------------------------------------------
229 
230 #include <OSD_Protection.hxx>
231 
232 #define FLAG_READ    0x00000001
233 #define FLAG_WRITE   0x00000002
234 #define FLAG_EXECUTE 0x00000004
235 #define FLAG_DELETE  0x00000008
236 
237 static Standard_Integer     __fastcall _get_mask ( OSD_SingleProtection );
238 static OSD_SingleProtection __fastcall _get_prot ( Standard_Integer     );
239 
OSD_Protection()240 OSD_Protection :: OSD_Protection () {
241 
242  s = OSD_RWXD;
243  u = OSD_RWXD;
244  g = OSD_RX;
245  w = OSD_RX;
246 
247 }  // end constructor ( 1 )
248 
OSD_Protection(const OSD_SingleProtection System,const OSD_SingleProtection User,const OSD_SingleProtection Group,const OSD_SingleProtection World)249 OSD_Protection :: OSD_Protection (
250                    const OSD_SingleProtection System,
251                    const OSD_SingleProtection User,
252                    const OSD_SingleProtection Group,
253                    const OSD_SingleProtection World
254                   ) {
255 
256  SetValues ( System, User, Group, World );
257 
258 }  // end constructor ( 2 )
259 
Values(OSD_SingleProtection & System,OSD_SingleProtection & User,OSD_SingleProtection & Group,OSD_SingleProtection & World)260 void OSD_Protection :: Values (
261                         OSD_SingleProtection& System,
262                         OSD_SingleProtection& User,
263                         OSD_SingleProtection& Group,
264                         OSD_SingleProtection& World
265                        ) {
266  System = s;
267  User   = u;
268  Group  = g;
269  World  = w;
270 
271 }  // end OSD_Protection :: Values
272 
SetValues(const OSD_SingleProtection System,const OSD_SingleProtection User,const OSD_SingleProtection Group,const OSD_SingleProtection World)273 void OSD_Protection :: SetValues (
274                         const OSD_SingleProtection System,
275                         const OSD_SingleProtection User,
276                         const OSD_SingleProtection Group,
277                         const OSD_SingleProtection World
278                        ) {
279 
280  s = System;
281  u = User;
282  g = Group;
283  w = World;
284 
285 }  // end OSD_Protection :: SetValues
286 
SetSystem(const OSD_SingleProtection priv)287 void OSD_Protection :: SetSystem ( const OSD_SingleProtection priv ) {
288 
289  s = priv;
290 
291 }  // end OSD_Protection :: SetSystem
292 
SetUser(const OSD_SingleProtection priv)293 void OSD_Protection :: SetUser ( const OSD_SingleProtection priv ) {
294 
295  u = priv;
296 
297 }  // end OSD_Protection :: SetUser
298 
SetGroup(const OSD_SingleProtection priv)299 void OSD_Protection :: SetGroup ( const OSD_SingleProtection priv ) {
300 
301  g = priv;
302 
303 }  // end OSD_Protection :: SetGroup
304 
SetWorld(const OSD_SingleProtection priv)305 void OSD_Protection :: SetWorld ( const OSD_SingleProtection priv ) {
306 
307  w = priv;
308 
309 }  // end OSD_Protection :: SetWorld
310 
System() const311 OSD_SingleProtection OSD_Protection :: System () const {
312 
313  return s;
314 
315 }  // end OSD_Protection :: System
316 
User() const317 OSD_SingleProtection OSD_Protection :: User () const {
318 
319  return u;
320 
321 }  // end OSD_Protection :: User
322 
Group() const323 OSD_SingleProtection OSD_Protection :: Group () const {
324 
325  return g;
326 
327 }  // end OSD_Protection :: Group
328 
World() const329 OSD_SingleProtection OSD_Protection :: World () const {
330 
331  return w;
332 
333 }  // end OSD_Protection :: World
334 
Add(OSD_SingleProtection & aProt,const OSD_SingleProtection aRight)335 void OSD_Protection :: Add (
336                         OSD_SingleProtection& aProt,
337                         const OSD_SingleProtection aRight
338                        ) {
339 
340  Standard_Integer pMask = 0;
341  Standard_Integer rMask = 0;
342  Standard_Integer sMask = 0;
343 
344  pMask = _get_mask ( aProt  );
345  rMask = _get_mask ( aRight );
346 
347  if (   (  rMask & FLAG_READ && !( pMask & FLAG_READ )  ) || pMask & FLAG_READ   )
348 
349   sMask |= FLAG_READ;
350 
351  if (   (  rMask & FLAG_WRITE && !( pMask & FLAG_WRITE )  ) || pMask & FLAG_WRITE   )
352 
353   sMask |= FLAG_WRITE;
354 
355  if (   (  rMask & FLAG_EXECUTE && !( pMask & FLAG_EXECUTE )  ) || pMask & FLAG_EXECUTE   )
356 
357   sMask |= FLAG_EXECUTE;
358 
359  if (   (  rMask & FLAG_DELETE && !( pMask & FLAG_DELETE )  ) || pMask & FLAG_DELETE   )
360 
361   sMask |= FLAG_DELETE;
362 
363  aProt = _get_prot ( sMask );
364 
365 }  // end OSD_Protection :: Add
366 
Sub(OSD_SingleProtection & aProt,const OSD_SingleProtection aRight)367 void OSD_Protection :: Sub (
368                         OSD_SingleProtection& aProt,
369                         const OSD_SingleProtection aRight
370                        ) {
371 
372  Standard_Integer pMask = 0;
373  Standard_Integer rMask = 0;
374 
375  pMask = _get_mask ( aProt  );
376  rMask = _get_mask ( aRight );
377 
378  if ( rMask & FLAG_READ )
379 
380   pMask &= ~FLAG_READ;
381 
382  if ( rMask & FLAG_WRITE )
383 
384   pMask &= ~FLAG_WRITE;
385 
386  if ( rMask & FLAG_EXECUTE )
387 
388   pMask &= ~FLAG_EXECUTE;
389 
390  if ( rMask & FLAG_DELETE )
391 
392   pMask &= ~FLAG_DELETE;
393 
394  aProt = _get_prot ( pMask );
395 
396 }  // end OSD_Protection :: Sub
397 
Internal() const398 Standard_Integer OSD_Protection :: Internal () const {
399 
400  return 0;
401 
402 }  // end OSD_Protection :: Internal
403 
_get_mask(OSD_SingleProtection p)404 static Standard_Integer __fastcall _get_mask ( OSD_SingleProtection p ) {
405 
406  Standard_Integer retVal = 0;
407 
408  if ( p == OSD_R   || p == OSD_RW   || p == OSD_RX || p == OSD_RWX ||
409       p == OSD_RXD || p == OSD_RWXD || p == OSD_RD || p == OSD_RWD
410  ) retVal |= FLAG_READ;
411 
412  if ( p == OSD_W   || p == OSD_RW   || p == OSD_WX || p == OSD_RWX ||
413       p == OSD_WXD || p == OSD_RWXD || p == OSD_WD || p == OSD_RWD
414  ) retVal |= FLAG_WRITE;
415 
416  if ( p == OSD_X  || p == OSD_RX  || p == OSD_WX  || p == OSD_RWX  ||
417       p == OSD_XD || p == OSD_RXD || p == OSD_WXD || p == OSD_RWXD
418  ) retVal |= FLAG_EXECUTE;
419 
420  if ( p == OSD_D  || p == OSD_RD  || p == OSD_WD  || p == OSD_RWD  ||
421       p == OSD_XD || p == OSD_RXD || p == OSD_WXD || p == OSD_RWXD
422  ) retVal |= FLAG_DELETE;
423 
424  return retVal;
425 
426 }  // end _get_mask
427 
_get_prot(Standard_Integer m)428 static OSD_SingleProtection __fastcall _get_prot ( Standard_Integer m ) {
429 
430  OSD_SingleProtection retVal;
431 
432  switch ( m ) {
433 
434   case FLAG_READ:
435 
436    retVal = OSD_R;
437 
438   break;
439 
440   case FLAG_WRITE:
441 
442    retVal = OSD_W;
443 
444   break;
445 
446   case FLAG_READ | FLAG_WRITE:
447 
448    retVal = OSD_RW;
449 
450   break;
451 
452   case FLAG_EXECUTE:
453 
454    retVal = OSD_X;
455 
456   break;
457 
458   case FLAG_READ | FLAG_EXECUTE:
459 
460    retVal = OSD_RX;
461 
462   break;
463 
464   case FLAG_WRITE | FLAG_EXECUTE:
465 
466    retVal = OSD_WX;
467 
468   break;
469 
470   case FLAG_READ | FLAG_WRITE | FLAG_EXECUTE:
471 
472    retVal = OSD_RWX;
473 
474   break;
475 
476   case FLAG_DELETE:
477 
478    retVal = OSD_D;
479 
480   break;
481 
482   case FLAG_READ | FLAG_DELETE:
483 
484    retVal = OSD_RD;
485 
486   break;
487 
488   case FLAG_WRITE | FLAG_DELETE:
489 
490    retVal = OSD_WD;
491 
492   break;
493 
494   case FLAG_READ | FLAG_WRITE | FLAG_DELETE:
495 
496    retVal = OSD_RWD;
497 
498   break;
499 
500   case FLAG_EXECUTE | FLAG_DELETE:
501 
502    retVal = OSD_XD;
503 
504   break;
505 
506   case FLAG_READ | FLAG_EXECUTE | FLAG_DELETE:
507 
508    retVal = OSD_RXD;
509 
510   break;
511 
512   case FLAG_WRITE | FLAG_EXECUTE | FLAG_DELETE:
513 
514    retVal = OSD_WXD;
515 
516   break;
517 
518   case FLAG_READ | FLAG_WRITE | FLAG_EXECUTE | FLAG_DELETE:
519 
520    retVal = OSD_RWXD;
521 
522   break;
523 
524   default:
525 
526    retVal = OSD_None;
527 
528  }  // end switch
529 
530  return retVal;
531 
532 }  // end _get_prot
533 
534 #endif
535