2003-08-13 05:53:07 +04:00
/*
Unix SMB / CIFS implementation .
SMB torture tester - deny mode scanning functions
Copyright ( C ) Andrew Tridgell 2001
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2003-08-13 05:53:07 +04:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-08-13 05:53:07 +04:00
*/
# include "includes.h"
2005-02-10 08:09:35 +03:00
# include "system/filesys.h"
2006-01-03 18:40:05 +03:00
# include "libcli/libcli.h"
2009-10-07 03:57:34 +04:00
# include "libcli/security/security.h"
2006-03-17 20:59:58 +03:00
# include "torture/util.h"
2009-10-07 03:57:34 +04:00
# include "cxd_known.h"
2011-03-19 02:42:52 +03:00
# include "torture/basic/proto.h"
2003-08-13 05:53:07 +04:00
2004-10-24 13:08:17 +04:00
extern int torture_failures ;
# define CHECK_MAX_FAILURES(label) do { if (++failures >= torture_failures) goto label; } while (0)
2003-08-13 05:53:07 +04:00
enum deny_result { A_0 = 0 , A_X = 1 , A_R = 2 , A_W = 3 , A_RW = 5 } ;
static const char * denystr ( int denymode )
{
2005-08-20 04:10:03 +04:00
const struct {
2003-08-13 05:53:07 +04:00
int v ;
const char * name ;
} deny_modes [ ] = {
{ DENY_DOS , " DENY_DOS " } ,
{ DENY_ALL , " DENY_ALL " } ,
{ DENY_WRITE , " DENY_WRITE " } ,
{ DENY_READ , " DENY_READ " } ,
{ DENY_NONE , " DENY_NONE " } ,
{ DENY_FCB , " DENY_FCB " } ,
{ - 1 , NULL } } ;
int i ;
for ( i = 0 ; deny_modes [ i ] . name ; i + + ) {
if ( deny_modes [ i ] . v = = denymode ) return deny_modes [ i ] . name ;
}
return " DENY_XXX " ;
}
static const char * openstr ( int mode )
{
2005-08-20 04:10:03 +04:00
const struct {
2003-08-13 05:53:07 +04:00
int v ;
const char * name ;
} open_modes [ ] = {
{ O_RDWR , " O_RDWR " } ,
{ O_RDONLY , " O_RDONLY " } ,
{ O_WRONLY , " O_WRONLY " } ,
{ - 1 , NULL } } ;
int i ;
for ( i = 0 ; open_modes [ i ] . name ; i + + ) {
if ( open_modes [ i ] . v = = mode ) return open_modes [ i ] . name ;
}
return " O_XXX " ;
}
static const char * resultstr ( enum deny_result res )
{
2005-08-20 04:10:03 +04:00
const struct {
2003-08-13 05:53:07 +04:00
enum deny_result res ;
const char * name ;
} results [ ] = {
{ A_X , " X " } ,
{ A_0 , " - " } ,
{ A_R , " R " } ,
{ A_W , " W " } ,
{ A_RW , " RW " } } ;
int i ;
2016-03-04 12:05:22 +03:00
for ( i = 0 ; i < ARRAY_SIZE ( results ) ; i + + ) {
2003-08-13 05:53:07 +04:00
if ( results [ i ] . res = = res ) return results [ i ] . name ;
}
return " * " ;
}
2004-09-23 04:47:38 +04:00
static const struct {
2003-08-13 05:53:07 +04:00
int isexe ;
int mode1 , deny1 ;
int mode2 , deny2 ;
enum deny_result result ;
} denytable2 [ ] = {
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_RW } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_R } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_W } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_READ , A_RW } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_READ , A_R } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_READ , A_W } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_R } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_R } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_W } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_READ , A_W } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_RW } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_R } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_W } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_READ , A_RW } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_READ , A_R } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_READ , A_W } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_R } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_R } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_R } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_W } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_READ , A_W } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_RW } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_R } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_W } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_READ , A_RW } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_READ , A_R } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_READ , A_W } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_0 }
} ;
2004-09-23 04:47:38 +04:00
static const struct {
2003-08-13 05:53:07 +04:00
int isexe ;
int mode1 , deny1 ;
int mode2 , deny2 ;
enum deny_result result ;
} denytable1 [ ] = {
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDWR , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_RW } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_R } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_W } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_READ , A_RW } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_READ , A_R } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_READ , A_W } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_R } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_R } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDWR , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_W } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_READ , A_W } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_WRONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDWR , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_RW } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_R } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_W } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_READ , A_RW } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_READ , A_R } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_READ , A_W } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 1 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDWR , DENY_FCB , O_RDWR , DENY_FCB , A_RW } ,
{ 1 , O_RDWR , DENY_FCB , O_RDONLY , DENY_FCB , A_RW } ,
{ 1 , O_RDWR , DENY_FCB , O_WRONLY , DENY_FCB , A_RW } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDWR , DENY_FCB , A_RW } ,
{ 1 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_RW } ,
{ 1 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_RW } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_DOS , A_RW } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_R } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_W } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDWR , DENY_FCB , A_RW } ,
{ 1 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_RW } ,
{ 1 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_DOS , O_RDWR , DENY_FCB , A_RW } ,
{ 0 , O_RDWR , DENY_DOS , O_RDONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDWR , DENY_DOS , O_WRONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_R } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_DOS , A_RW } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_DOS , A_W } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDWR , DENY_FCB , A_RW } ,
{ 0 , O_WRONLY , DENY_DOS , O_RDONLY , DENY_FCB , A_RW } ,
{ 0 , O_WRONLY , DENY_DOS , O_WRONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_ALL , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_R } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_READ , A_R } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_WRITE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDWR , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_W } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_READ , A_W } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_WRONLY , DENY_READ , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_READ , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDWR , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_RW } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_R } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_W } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_DOS , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_READ , A_RW } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_READ , A_R } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_READ , A_W } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_NONE , A_RW } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_NONE , A_R } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_NONE , A_W } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDWR , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_RDONLY , DENY_FCB , A_0 } ,
{ 0 , O_WRONLY , DENY_NONE , O_WRONLY , DENY_FCB , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_DOS , A_RW } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_DOS , A_W } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDWR , DENY_FCB , O_RDWR , DENY_FCB , A_RW } ,
{ 0 , O_RDWR , DENY_FCB , O_RDONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDWR , DENY_FCB , O_WRONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_DOS , A_RW } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_W } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDWR , DENY_FCB , A_RW } ,
{ 0 , O_RDONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_RW } ,
{ 0 , O_RDONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_RW } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_DOS , A_RW } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_DOS , A_R } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_DOS , A_W } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_ALL , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_WRITE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_READ , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_NONE , A_0 } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDWR , DENY_FCB , A_RW } ,
{ 0 , O_WRONLY , DENY_FCB , O_RDONLY , DENY_FCB , A_RW } ,
{ 0 , O_WRONLY , DENY_FCB , O_WRONLY , DENY_FCB , A_RW }
} ;
2010-01-05 20:42:54 +03:00
static void progress_bar ( struct torture_context * tctx , unsigned int i , unsigned int total )
2003-08-13 05:53:07 +04:00
{
2007-04-30 01:37:29 +04:00
if ( torture_setting_bool ( tctx , " progress " , true ) ) {
torture_comment ( tctx , " %5d/%5d \r " , i , total ) ;
fflush ( stdout ) ;
}
2003-08-13 05:53:07 +04:00
}
/*
this produces a matrix of deny mode behaviour for 1 connection
*/
2007-09-07 19:08:14 +04:00
bool torture_denytest1 ( struct torture_context * tctx ,
struct smbcli_state * cli1 )
2003-08-13 05:53:07 +04:00
{
int fnum1 , fnum2 ;
int i ;
2007-10-07 02:28:14 +04:00
bool correct = true ;
2010-08-30 20:58:20 +04:00
struct timespec tv , tv_start ;
2003-08-13 05:53:07 +04:00
const char * fnames [ 2 ] = { " \\ denytest1.dat " , " \\ denytest1.exe " } ;
2004-10-24 13:08:17 +04:00
int failures = 0 ;
2003-08-13 05:53:07 +04:00
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " Testing deny modes with 1 connection \n " ) ;
2003-08-13 05:53:07 +04:00
for ( i = 0 ; i < 2 ; i + + ) {
2004-08-04 17:23:35 +04:00
smbcli_unlink ( cli1 - > tree , fnames [ i ] ) ;
fnum1 = smbcli_open ( cli1 - > tree , fnames [ i ] , O_RDWR | O_CREAT , DENY_NONE ) ;
smbcli_write ( cli1 - > tree , fnum1 , 0 , fnames [ i ] , 0 , strlen ( fnames [ i ] ) ) ;
smbcli_close ( cli1 - > tree , fnum1 ) ;
2003-08-13 05:53:07 +04:00
}
2010-04-11 03:39:06 +04:00
torture_comment ( tctx , " Testing %d entries \n " , ( int ) ARRAY_SIZE ( denytable1 ) ) ;
2003-08-13 05:53:07 +04:00
2010-08-30 20:58:20 +04:00
clock_gettime_mono ( & tv_start ) ;
2004-06-08 23:25:26 +04:00
2003-08-13 05:53:07 +04:00
for ( i = 0 ; i < ARRAY_SIZE ( denytable1 ) ; i + + ) {
enum deny_result res ;
const char * fname = fnames [ denytable1 [ i ] . isexe ] ;
2006-10-16 17:06:41 +04:00
progress_bar ( tctx , i , ARRAY_SIZE ( denytable1 ) ) ;
2003-08-13 05:53:07 +04:00
2009-11-09 21:32:06 +03:00
if ( ! torture_setting_bool ( tctx , " deny_fcb_support " , true ) & &
( denytable1 [ i ] . deny1 = = DENY_FCB | |
denytable1 [ i ] . deny2 = = DENY_FCB ) )
continue ;
if ( ! torture_setting_bool ( tctx , " deny_dos_support " , true ) & &
( denytable1 [ i ] . deny1 = = DENY_DOS | |
denytable1 [ i ] . deny2 = = DENY_DOS ) )
continue ;
2004-08-04 17:23:35 +04:00
fnum1 = smbcli_open ( cli1 - > tree , fname ,
2003-08-13 05:53:07 +04:00
denytable1 [ i ] . mode1 ,
denytable1 [ i ] . deny1 ) ;
2004-08-04 17:23:35 +04:00
fnum2 = smbcli_open ( cli1 - > tree , fname ,
2003-08-13 05:53:07 +04:00
denytable1 [ i ] . mode2 ,
denytable1 [ i ] . deny2 ) ;
if ( fnum1 = = - 1 ) {
res = A_X ;
} else if ( fnum2 = = - 1 ) {
res = A_0 ;
} else {
2004-12-04 16:56:25 +03:00
uint8_t x = 1 ;
2003-08-13 05:53:07 +04:00
res = A_0 ;
2004-12-04 16:56:25 +03:00
if ( smbcli_read ( cli1 - > tree , fnum2 , & x , 0 , 1 ) = = 1 ) {
2003-08-13 05:53:07 +04:00
res + = A_R ;
}
2004-12-04 16:56:25 +03:00
if ( smbcli_write ( cli1 - > tree , fnum2 , 0 , & x , 0 , 1 ) = = 1 ) {
2003-08-13 05:53:07 +04:00
res + = A_W ;
}
}
2007-10-07 02:28:14 +04:00
if ( torture_setting_bool ( tctx , " showall " , false ) | |
2006-10-16 17:06:41 +04:00
res ! = denytable1 [ i ] . result ) {
2004-06-23 19:22:41 +04:00
int64_t tdif ;
2010-08-30 20:58:20 +04:00
clock_gettime_mono ( & tv ) ;
tdif = nsec_time_diff ( & tv , & tv_start ) ;
tdif / = 1000000 ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " %lld: %s %8s %10s %8s %10s %s (correct=%s) \n " ,
2005-11-30 05:08:15 +03:00
( long long ) tdif ,
2003-08-13 05:53:07 +04:00
fname ,
denystr ( denytable1 [ i ] . deny1 ) ,
openstr ( denytable1 [ i ] . mode1 ) ,
denystr ( denytable1 [ i ] . deny2 ) ,
openstr ( denytable1 [ i ] . mode2 ) ,
resultstr ( res ) ,
resultstr ( denytable1 [ i ] . result ) ) ;
}
2004-10-24 13:08:17 +04:00
if ( res ! = denytable1 [ i ] . result ) {
2007-10-07 02:28:14 +04:00
correct = false ;
2004-10-24 13:08:17 +04:00
CHECK_MAX_FAILURES ( failed ) ;
}
2004-08-04 17:23:35 +04:00
smbcli_close ( cli1 - > tree , fnum1 ) ;
smbcli_close ( cli1 - > tree , fnum2 ) ;
2003-08-13 05:53:07 +04:00
}
2004-10-24 13:08:17 +04:00
failed :
2003-08-13 05:53:07 +04:00
for ( i = 0 ; i < 2 ; i + + ) {
2004-08-04 17:23:35 +04:00
smbcli_unlink ( cli1 - > tree , fnames [ i ] ) ;
2003-08-13 05:53:07 +04:00
}
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " finshed denytest1 (%d failures) \n " , failures ) ;
2003-08-13 05:53:07 +04:00
return correct ;
}
/*
this produces a matrix of deny mode behaviour with 2 connections
*/
2007-09-07 19:08:14 +04:00
bool torture_denytest2 ( struct torture_context * tctx ,
struct smbcli_state * cli1 ,
struct smbcli_state * cli2 )
2003-08-13 05:53:07 +04:00
{
int fnum1 , fnum2 ;
int i ;
2007-10-07 02:28:14 +04:00
bool correct = true ;
2003-08-13 05:53:07 +04:00
const char * fnames [ 2 ] = { " \\ denytest2.dat " , " \\ denytest2.exe " } ;
2010-08-30 20:58:20 +04:00
struct timespec tv , tv_start ;
2004-10-24 13:08:17 +04:00
int failures = 0 ;
2003-08-13 05:53:07 +04:00
for ( i = 0 ; i < 2 ; i + + ) {
2004-08-04 17:23:35 +04:00
smbcli_unlink ( cli1 - > tree , fnames [ i ] ) ;
fnum1 = smbcli_open ( cli1 - > tree , fnames [ i ] , O_RDWR | O_CREAT , DENY_NONE ) ;
smbcli_write ( cli1 - > tree , fnum1 , 0 , fnames [ i ] , 0 , strlen ( fnames [ i ] ) ) ;
smbcli_close ( cli1 - > tree , fnum1 ) ;
2003-08-13 05:53:07 +04:00
}
2010-08-30 20:58:20 +04:00
clock_gettime_mono ( & tv_start ) ;
2004-06-08 23:25:26 +04:00
2003-08-13 05:53:07 +04:00
for ( i = 0 ; i < ARRAY_SIZE ( denytable2 ) ; i + + ) {
enum deny_result res ;
const char * fname = fnames [ denytable2 [ i ] . isexe ] ;
2006-10-16 17:06:41 +04:00
progress_bar ( tctx , i , ARRAY_SIZE ( denytable1 ) ) ;
2003-08-13 05:53:07 +04:00
2009-11-09 21:32:06 +03:00
if ( ! torture_setting_bool ( tctx , " deny_fcb_support " , true ) & &
( denytable1 [ i ] . deny1 = = DENY_FCB | |
denytable1 [ i ] . deny2 = = DENY_FCB ) )
continue ;
if ( ! torture_setting_bool ( tctx , " deny_dos_support " , true ) & &
( denytable1 [ i ] . deny1 = = DENY_DOS | |
denytable1 [ i ] . deny2 = = DENY_DOS ) )
continue ;
2004-08-04 17:23:35 +04:00
fnum1 = smbcli_open ( cli1 - > tree , fname ,
2003-08-13 05:53:07 +04:00
denytable2 [ i ] . mode1 ,
denytable2 [ i ] . deny1 ) ;
2004-08-04 17:23:35 +04:00
fnum2 = smbcli_open ( cli2 - > tree , fname ,
2003-08-13 05:53:07 +04:00
denytable2 [ i ] . mode2 ,
denytable2 [ i ] . deny2 ) ;
if ( fnum1 = = - 1 ) {
res = A_X ;
} else if ( fnum2 = = - 1 ) {
res = A_0 ;
} else {
2004-12-04 16:56:25 +03:00
uint8_t x = 1 ;
2003-08-13 05:53:07 +04:00
res = A_0 ;
2004-12-04 16:56:25 +03:00
if ( smbcli_read ( cli2 - > tree , fnum2 , & x , 0 , 1 ) = = 1 ) {
2003-08-13 05:53:07 +04:00
res + = A_R ;
}
2004-12-04 16:56:25 +03:00
if ( smbcli_write ( cli2 - > tree , fnum2 , 0 , & x , 0 , 1 ) = = 1 ) {
2003-08-13 05:53:07 +04:00
res + = A_W ;
}
}
2007-10-07 02:28:14 +04:00
if ( torture_setting_bool ( tctx , " showall " , false ) | |
2006-10-16 17:06:41 +04:00
res ! = denytable2 [ i ] . result ) {
2004-06-23 19:22:41 +04:00
int64_t tdif ;
2010-08-30 20:58:20 +04:00
clock_gettime_mono ( & tv ) ;
tdif = nsec_time_diff ( & tv , & tv_start ) ;
tdif / = 1000000 ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " %lld: %s %8s %10s %8s %10s %s (correct=%s) \n " ,
2005-11-30 05:08:15 +03:00
( long long ) tdif ,
2003-08-13 05:53:07 +04:00
fname ,
denystr ( denytable2 [ i ] . deny1 ) ,
openstr ( denytable2 [ i ] . mode1 ) ,
denystr ( denytable2 [ i ] . deny2 ) ,
openstr ( denytable2 [ i ] . mode2 ) ,
resultstr ( res ) ,
resultstr ( denytable2 [ i ] . result ) ) ;
}
2004-10-24 13:08:17 +04:00
if ( res ! = denytable2 [ i ] . result ) {
2007-10-07 02:28:14 +04:00
correct = false ;
2004-10-24 13:08:17 +04:00
CHECK_MAX_FAILURES ( failed ) ;
}
2004-08-04 17:23:35 +04:00
smbcli_close ( cli1 - > tree , fnum1 ) ;
smbcli_close ( cli2 - > tree , fnum2 ) ;
2003-08-13 05:53:07 +04:00
}
2004-10-24 13:08:17 +04:00
failed :
2003-08-13 05:53:07 +04:00
for ( i = 0 ; i < 2 ; i + + ) {
2004-08-04 17:23:35 +04:00
smbcli_unlink ( cli1 - > tree , fnames [ i ] ) ;
2003-08-13 05:53:07 +04:00
}
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " finshed denytest2 (%d failures) \n " , failures ) ;
2003-08-13 05:53:07 +04:00
return correct ;
}
2004-10-25 11:24:46 +04:00
/*
simple test harness for playing with deny modes
*/
2007-09-07 19:08:14 +04:00
bool torture_denytest3 ( struct torture_context * tctx ,
struct smbcli_state * cli1 ,
struct smbcli_state * cli2 )
2004-10-25 11:24:46 +04:00
{
int fnum1 , fnum2 ;
const char * fname ;
fname = " \\ deny_dos1.dat " ;
smbcli_unlink ( cli1 - > tree , fname ) ;
fnum1 = smbcli_open ( cli1 - > tree , fname , O_CREAT | O_TRUNC | O_WRONLY , DENY_DOS ) ;
fnum2 = smbcli_open ( cli1 - > tree , fname , O_CREAT | O_TRUNC | O_WRONLY , DENY_DOS ) ;
if ( fnum1 ! = - 1 ) smbcli_close ( cli1 - > tree , fnum1 ) ;
if ( fnum2 ! = - 1 ) smbcli_close ( cli1 - > tree , fnum2 ) ;
smbcli_unlink ( cli1 - > tree , fname ) ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " fnum1=%d fnum2=%d \n " , fnum1 , fnum2 ) ;
2004-10-25 11:24:46 +04:00
fname = " \\ deny_dos2.dat " ;
smbcli_unlink ( cli1 - > tree , fname ) ;
fnum1 = smbcli_open ( cli1 - > tree , fname , O_CREAT | O_TRUNC | O_WRONLY , DENY_DOS ) ;
fnum2 = smbcli_open ( cli2 - > tree , fname , O_CREAT | O_TRUNC | O_WRONLY , DENY_DOS ) ;
if ( fnum1 ! = - 1 ) smbcli_close ( cli1 - > tree , fnum1 ) ;
if ( fnum2 ! = - 1 ) smbcli_close ( cli2 - > tree , fnum2 ) ;
smbcli_unlink ( cli1 - > tree , fname ) ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " fnum1=%d fnum2=%d \n " , fnum1 , fnum2 ) ;
2004-10-25 11:24:46 +04:00
2007-10-07 02:28:14 +04:00
return true ;
2004-10-25 11:24:46 +04:00
}
2004-10-30 08:59:52 +04:00
struct bit_value {
uint32_t value ;
const char * name ;
} ;
static uint32_t map_bits ( const struct bit_value * bv , int b , int nbits )
{
int i ;
uint32_t ret = 0 ;
for ( i = 0 ; i < nbits ; i + + ) {
if ( b & ( 1 < < i ) ) {
ret | = bv [ i ] . value ;
}
}
return ret ;
}
static const char * bit_string ( TALLOC_CTX * mem_ctx , const struct bit_value * bv , int b , int nbits )
{
char * ret = NULL ;
int i ;
for ( i = 0 ; i < nbits ; i + + ) {
if ( b & ( 1 < < i ) ) {
if ( ret = = NULL ) {
ret = talloc_asprintf ( mem_ctx , " %s " , bv [ i ] . name ) ;
} else {
2007-09-15 03:21:00 +04:00
ret = talloc_asprintf_append_buffer ( ret , " | %s " , bv [ i ] . name ) ;
2004-10-30 08:59:52 +04:00
}
}
}
if ( ret = = NULL ) ret = talloc_strdup ( mem_ctx , " (NONE) " ) ;
return ret ;
}
/*
determine if two opens conflict
*/
static NTSTATUS predict_share_conflict ( uint32_t sa1 , uint32_t am1 , uint32_t sa2 , uint32_t am2 ,
2007-10-07 02:28:14 +04:00
bool read_for_execute , enum deny_result * res )
2004-10-30 08:59:52 +04:00
{
# define CHECK_MASK(am, sa, right, share) do { \
if ( ( ( am ) & ( right ) ) & & ! ( ( sa ) & ( share ) ) ) { \
* res = A_0 ; \
return NT_STATUS_SHARING_VIOLATION ; \
} } while ( 0 )
* res = A_0 ;
2004-11-30 07:33:27 +03:00
if ( am2 & ( SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA ) ) {
2004-10-30 08:59:52 +04:00
* res + = A_W ;
}
2004-11-30 07:33:27 +03:00
if ( am2 & SEC_FILE_READ_DATA ) {
2004-10-30 08:59:52 +04:00
* res + = A_R ;
2006-03-11 15:58:36 +03:00
} else if ( ( am2 & SEC_FILE_EXECUTE ) & & read_for_execute ) {
2004-10-31 06:26:30 +03:00
* res + = A_R ;
2004-10-30 08:59:52 +04:00
}
/* if either open involves no read.write or delete access then
it can ' t conflict */
2004-11-30 07:33:27 +03:00
if ( ! ( am1 & ( SEC_FILE_WRITE_DATA |
SEC_FILE_APPEND_DATA |
SEC_FILE_READ_DATA |
SEC_FILE_EXECUTE |
SEC_STD_DELETE ) ) ) {
2004-10-30 08:59:52 +04:00
return NT_STATUS_OK ;
}
2004-11-30 07:33:27 +03:00
if ( ! ( am2 & ( SEC_FILE_WRITE_DATA |
SEC_FILE_APPEND_DATA |
SEC_FILE_READ_DATA |
SEC_FILE_EXECUTE |
SEC_STD_DELETE ) ) ) {
2004-10-30 08:59:52 +04:00
return NT_STATUS_OK ;
}
/* check the basic share access */
CHECK_MASK ( am1 , sa2 ,
2004-11-30 07:33:27 +03:00
SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA ,
2004-10-30 08:59:52 +04:00
NTCREATEX_SHARE_ACCESS_WRITE ) ;
CHECK_MASK ( am2 , sa1 ,
2004-11-30 07:33:27 +03:00
SEC_FILE_WRITE_DATA | SEC_FILE_APPEND_DATA ,
2004-10-30 08:59:52 +04:00
NTCREATEX_SHARE_ACCESS_WRITE ) ;
CHECK_MASK ( am1 , sa2 ,
2004-11-30 07:33:27 +03:00
SEC_FILE_READ_DATA | SEC_FILE_EXECUTE ,
2004-10-30 08:59:52 +04:00
NTCREATEX_SHARE_ACCESS_READ ) ;
CHECK_MASK ( am2 , sa1 ,
2004-11-30 07:33:27 +03:00
SEC_FILE_READ_DATA | SEC_FILE_EXECUTE ,
2004-10-30 08:59:52 +04:00
NTCREATEX_SHARE_ACCESS_READ ) ;
CHECK_MASK ( am1 , sa2 ,
2004-11-30 07:33:27 +03:00
SEC_STD_DELETE ,
2004-10-30 08:59:52 +04:00
NTCREATEX_SHARE_ACCESS_DELETE ) ;
CHECK_MASK ( am2 , sa1 ,
2004-11-30 07:33:27 +03:00
SEC_STD_DELETE ,
2004-10-30 08:59:52 +04:00
NTCREATEX_SHARE_ACCESS_DELETE ) ;
return NT_STATUS_OK ;
}
/*
a denytest for ntcreatex
*/
2007-10-07 02:28:14 +04:00
static bool torture_ntdenytest ( struct torture_context * tctx ,
2009-11-07 21:51:47 +03:00
struct smbcli_state * cli1 ,
struct smbcli_state * cli2 , int client )
2004-10-30 08:59:52 +04:00
{
const struct bit_value share_access_bits [ ] = {
{ NTCREATEX_SHARE_ACCESS_READ , " S_R " } ,
{ NTCREATEX_SHARE_ACCESS_WRITE , " S_W " } ,
{ NTCREATEX_SHARE_ACCESS_DELETE , " S_D " }
} ;
const struct bit_value access_mask_bits [ ] = {
2004-11-30 07:33:27 +03:00
{ SEC_FILE_READ_DATA , " R_DATA " } ,
{ SEC_FILE_WRITE_DATA , " W_DATA " } ,
{ SEC_FILE_READ_ATTRIBUTE , " R_ATTR " } ,
{ SEC_FILE_WRITE_ATTRIBUTE , " W_ATTR " } ,
{ SEC_FILE_READ_EA , " R_EAS " } ,
{ SEC_FILE_WRITE_EA , " W_EAS " } ,
{ SEC_FILE_APPEND_DATA , " A_DATA " } ,
{ SEC_FILE_EXECUTE , " EXEC " }
2004-10-30 08:59:52 +04:00
} ;
int fnum1 ;
int i ;
2007-10-07 02:28:14 +04:00
bool correct = true ;
2010-08-30 20:58:20 +04:00
struct timespec tv , tv_start ;
2004-10-30 08:59:52 +04:00
const char * fname ;
int nbits1 = ARRAY_SIZE ( share_access_bits ) ;
int nbits2 = ARRAY_SIZE ( access_mask_bits ) ;
union smb_open io1 , io2 ;
extern int torture_numops ;
int failures = 0 ;
2004-12-04 16:56:25 +03:00
uint8_t buf [ 1 ] ;
2004-10-30 08:59:52 +04:00
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " format: server correct \n " ) ;
2005-08-04 08:23:40 +04:00
2004-10-30 09:53:56 +04:00
ZERO_STRUCT ( buf ) ;
fname = talloc_asprintf ( cli1 , " \\ ntdeny_%d.dll " , client ) ;
2004-10-30 08:59:52 +04:00
smbcli_unlink ( cli1 - > tree , fname ) ;
fnum1 = smbcli_open ( cli1 - > tree , fname , O_RDWR | O_CREAT , DENY_NONE ) ;
2004-10-30 09:53:56 +04:00
smbcli_write ( cli1 - > tree , fnum1 , 0 , buf , 0 , sizeof ( buf ) ) ;
2004-10-30 08:59:52 +04:00
smbcli_close ( cli1 - > tree , fnum1 ) ;
2010-08-30 20:58:20 +04:00
clock_gettime_mono ( & tv_start ) ;
2004-10-30 08:59:52 +04:00
io1 . ntcreatex . level = RAW_OPEN_NTCREATEX ;
2009-10-15 11:26:19 +04:00
io1 . ntcreatex . in . root_fid . fnum = 0 ;
2004-10-30 09:53:56 +04:00
io1 . ntcreatex . in . flags = NTCREATEX_FLAGS_EXTENDED ;
io1 . ntcreatex . in . create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE ;
io1 . ntcreatex . in . file_attr = 0 ;
2004-10-30 08:59:52 +04:00
io1 . ntcreatex . in . alloc_size = 0 ;
io1 . ntcreatex . in . open_disposition = NTCREATEX_DISP_OPEN ;
2004-10-30 09:53:56 +04:00
io1 . ntcreatex . in . impersonation = NTCREATEX_IMPERSONATION_IMPERSONATION ;
2004-10-30 08:59:52 +04:00
io1 . ntcreatex . in . security_flags = 0 ;
io1 . ntcreatex . in . fname = fname ;
io2 = io1 ;
2010-04-11 03:39:06 +04:00
torture_comment ( tctx , " Testing %d entries on %s \n " , torture_numops , fname ) ;
2004-10-30 08:59:52 +04:00
for ( i = 0 ; i < torture_numops ; i + + ) {
NTSTATUS status1 , status2 , status2_p ;
2005-01-06 05:32:43 +03:00
TALLOC_CTX * mem_ctx = talloc_new ( NULL ) ;
2004-10-30 08:59:52 +04:00
enum deny_result res , res2 ;
int b_sa1 = random ( ) & ( ( 1 < < nbits1 ) - 1 ) ;
int b_am1 = random ( ) & ( ( 1 < < nbits2 ) - 1 ) ;
int b_sa2 = random ( ) & ( ( 1 < < nbits1 ) - 1 ) ;
int b_am2 = random ( ) & ( ( 1 < < nbits2 ) - 1 ) ;
2007-10-07 02:28:14 +04:00
bool read_for_execute ;
2004-10-30 08:59:52 +04:00
2006-10-16 17:06:41 +04:00
progress_bar ( tctx , i , torture_numops ) ;
2004-10-30 08:59:52 +04:00
io1 . ntcreatex . in . share_access = map_bits ( share_access_bits , b_sa1 , nbits1 ) ;
io1 . ntcreatex . in . access_mask = map_bits ( access_mask_bits , b_am1 , nbits2 ) ;
io2 . ntcreatex . in . share_access = map_bits ( share_access_bits , b_sa2 , nbits1 ) ;
io2 . ntcreatex . in . access_mask = map_bits ( access_mask_bits , b_am2 , nbits2 ) ;
2004-10-30 09:53:56 +04:00
2004-10-30 08:59:52 +04:00
status1 = smb_raw_open ( cli1 - > tree , mem_ctx , & io1 ) ;
status2 = smb_raw_open ( cli2 - > tree , mem_ctx , & io2 ) ;
2004-10-31 06:26:30 +03:00
if ( random ( ) % 2 = = 0 ) {
2007-10-07 02:28:14 +04:00
read_for_execute = true ;
2004-10-31 06:26:30 +03:00
} else {
2007-10-07 02:28:14 +04:00
read_for_execute = false ;
2004-10-31 06:26:30 +03:00
}
2004-10-30 08:59:52 +04:00
if ( ! NT_STATUS_IS_OK ( status1 ) ) {
res = A_X ;
} else if ( ! NT_STATUS_IS_OK ( status2 ) ) {
res = A_0 ;
} else {
2006-03-11 15:58:36 +03:00
union smb_read r ;
NTSTATUS status ;
/* we can't use smbcli_read() as we need to
set read_for_execute */
r . readx . level = RAW_READ_READX ;
2006-03-13 01:48:25 +03:00
r . readx . in . file . fnum = io2 . ntcreatex . out . file . fnum ;
2006-03-11 15:58:36 +03:00
r . readx . in . offset = 0 ;
r . readx . in . mincnt = sizeof ( buf ) ;
r . readx . in . maxcnt = sizeof ( buf ) ;
r . readx . in . remaining = 0 ;
r . readx . in . read_for_execute = read_for_execute ;
r . readx . out . data = buf ;
2004-10-30 08:59:52 +04:00
res = A_0 ;
2006-03-11 15:58:36 +03:00
status = smb_raw_read ( cli2 - > tree , & r ) ;
if ( NT_STATUS_IS_OK ( status ) ) {
2004-10-30 08:59:52 +04:00
res + = A_R ;
}
2006-03-13 01:48:25 +03:00
if ( smbcli_write ( cli2 - > tree , io2 . ntcreatex . out . file . fnum ,
0 , buf , 0 , sizeof ( buf ) ) > = 1 ) {
2004-10-30 08:59:52 +04:00
res + = A_W ;
}
}
if ( NT_STATUS_IS_OK ( status1 ) ) {
2006-03-13 01:48:25 +03:00
smbcli_close ( cli1 - > tree , io1 . ntcreatex . out . file . fnum ) ;
2004-10-30 08:59:52 +04:00
}
if ( NT_STATUS_IS_OK ( status2 ) ) {
2006-03-13 01:48:25 +03:00
smbcli_close ( cli2 - > tree , io2 . ntcreatex . out . file . fnum ) ;
2004-10-30 08:59:52 +04:00
}
status2_p = predict_share_conflict ( io1 . ntcreatex . in . share_access ,
io1 . ntcreatex . in . access_mask ,
io2 . ntcreatex . in . share_access ,
2004-10-31 06:26:30 +03:00
io2 . ntcreatex . in . access_mask ,
2006-03-11 15:58:36 +03:00
read_for_execute ,
2004-10-31 06:26:30 +03:00
& res2 ) ;
2004-10-30 08:59:52 +04:00
2010-08-30 20:58:20 +04:00
clock_gettime_mono ( & tv ) ;
2007-10-07 02:28:14 +04:00
if ( torture_setting_bool ( tctx , " showall " , false ) | |
2004-10-30 08:59:52 +04:00
! NT_STATUS_EQUAL ( status2 , status2_p ) | |
res ! = res2 ) {
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " \n %-20s %-70s \n %-20s %-70s %4s %4s %s/%s \n " ,
2004-10-30 08:59:52 +04:00
bit_string ( mem_ctx , share_access_bits , b_sa1 , nbits1 ) ,
bit_string ( mem_ctx , access_mask_bits , b_am1 , nbits2 ) ,
bit_string ( mem_ctx , share_access_bits , b_sa2 , nbits1 ) ,
bit_string ( mem_ctx , access_mask_bits , b_am2 , nbits2 ) ,
resultstr ( res ) ,
resultstr ( res2 ) ,
nt_errstr ( status2 ) ,
nt_errstr ( status2_p ) ) ;
fflush ( stdout ) ;
}
if ( res ! = res2 | |
! NT_STATUS_EQUAL ( status2 , status2_p ) ) {
CHECK_MAX_FAILURES ( failed ) ;
2007-10-07 02:28:14 +04:00
correct = false ;
2004-10-30 08:59:52 +04:00
}
talloc_free ( mem_ctx ) ;
}
failed :
smbcli_unlink ( cli1 - > tree , fname ) ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " finshed ntdenytest (%d failures) \n " , failures ) ;
2004-10-30 08:59:52 +04:00
return correct ;
}
/*
a denytest for ntcreatex
*/
2007-09-07 19:08:14 +04:00
bool torture_ntdenytest1 ( struct torture_context * tctx ,
struct smbcli_state * cli , int client )
2004-10-30 08:59:52 +04:00
{
extern int torture_seed ;
srandom ( torture_seed + client ) ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " starting ntdenytest1 client %d \n " , client ) ;
2004-10-30 08:59:52 +04:00
2006-10-16 17:06:41 +04:00
return torture_ntdenytest ( tctx , cli , cli , client ) ;
2004-10-30 08:59:52 +04:00
}
/*
a denytest for ntcreatex
*/
2007-09-07 19:08:14 +04:00
bool torture_ntdenytest2 ( struct torture_context * torture ,
struct smbcli_state * cli1 ,
struct smbcli_state * cli2 )
2004-10-30 08:59:52 +04:00
{
2006-10-16 17:06:41 +04:00
return torture_ntdenytest ( torture , cli1 , cli2 , 0 ) ;
2004-10-30 08:59:52 +04:00
}
2004-11-08 04:21:45 +03:00
2009-10-07 03:57:34 +04:00
# define COMPARE_STATUS(status, correct) do { \
if ( ! NT_STATUS_EQUAL ( status , correct ) ) { \
torture_result ( tctx , TORTURE_FAIL , \
" (%s) Incorrect status %s - should be %s \n " , \
__location__ , nt_errstr ( status ) , nt_errstr ( correct ) ) ; \
ret = false ; \
failed = true ; \
} } while ( 0 )
2004-11-08 04:21:45 +03:00
# define CHECK_STATUS(status, correct) do { \
if ( ! NT_STATUS_EQUAL ( status , correct ) ) { \
2009-10-07 03:43:43 +04:00
torture_result ( tctx , TORTURE_FAIL , \
" (%s) Incorrect status %s - should be %s \n " , \
2004-11-08 04:21:45 +03:00
__location__ , nt_errstr ( status ) , nt_errstr ( correct ) ) ; \
2007-10-07 02:28:14 +04:00
ret = false ; \
2004-11-08 04:21:45 +03:00
goto done ; \
} } while ( 0 )
# define CHECK_VAL(v, correct) do { \
if ( ( v ) ! = ( correct ) ) { \
2009-10-07 03:43:43 +04:00
torture_result ( tctx , TORTURE_FAIL , \
" (%s) wrong value for %s 0x%x - should be 0x%x \n " , \
2004-11-08 04:21:45 +03:00
__location__ , # v , ( int ) ( v ) , ( int ) correct ) ; \
2007-10-07 02:28:14 +04:00
ret = false ; \
2004-11-08 04:21:45 +03:00
} } while ( 0 )
/*
test sharing of handles with DENY_DOS on a single connection
*/
2007-09-07 19:08:14 +04:00
bool torture_denydos_sharing ( struct torture_context * tctx ,
struct smbcli_state * cli )
2004-11-08 04:21:45 +03:00
{
union smb_open io ;
union smb_fileinfo finfo ;
const char * fname = " \\ torture_denydos.txt " ;
NTSTATUS status ;
2004-12-02 07:51:56 +03:00
int fnum1 = - 1 , fnum2 = - 1 ;
2007-10-07 02:28:14 +04:00
bool ret = true ;
2004-11-08 04:21:45 +03:00
union smb_setfileinfo sfinfo ;
TALLOC_CTX * mem_ctx ;
2005-01-06 05:32:43 +03:00
mem_ctx = talloc_new ( cli ) ;
2004-11-08 04:21:45 +03:00
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " Checking DENY_DOS shared handle semantics \n " ) ;
2004-11-08 04:21:45 +03:00
smbcli_unlink ( cli - > tree , fname ) ;
io . openx . level = RAW_OPEN_OPENX ;
io . openx . in . fname = fname ;
io . openx . in . flags = OPENX_FLAGS_ADDITIONAL_INFO ;
io . openx . in . open_mode = OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_DOS ;
io . openx . in . open_func = OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE ;
io . openx . in . search_attrs = 0 ;
io . openx . in . file_attrs = 0 ;
io . openx . in . write_time = 0 ;
io . openx . in . size = 0 ;
io . openx . in . timeout = 0 ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " openx twice with RDWR/DENY_DOS \n " ) ;
2004-11-08 04:21:45 +03:00
status = smb_raw_open ( cli - > tree , mem_ctx , & io ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
2006-03-13 01:48:25 +03:00
fnum1 = io . openx . out . file . fnum ;
2004-11-08 04:21:45 +03:00
status = smb_raw_open ( cli - > tree , mem_ctx , & io ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
2006-03-13 01:48:25 +03:00
fnum2 = io . openx . out . file . fnum ;
2004-11-08 04:21:45 +03:00
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " fnum1=%d fnum2=%d \n " , fnum1 , fnum2 ) ;
2004-11-08 04:21:45 +03:00
sfinfo . generic . level = RAW_SFILEINFO_POSITION_INFORMATION ;
2006-03-13 01:48:25 +03:00
sfinfo . position_information . in . file . fnum = fnum1 ;
2004-11-08 04:21:45 +03:00
sfinfo . position_information . in . position = 1000 ;
status = smb_raw_setfileinfo ( cli - > tree , & sfinfo ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " two handles should be same file handle \n " ) ;
2004-11-08 04:21:45 +03:00
finfo . position_information . level = RAW_FILEINFO_POSITION_INFORMATION ;
2006-03-13 01:48:25 +03:00
finfo . position_information . in . file . fnum = fnum1 ;
2004-11-08 04:21:45 +03:00
status = smb_raw_fileinfo ( cli - > tree , mem_ctx , & finfo ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
CHECK_VAL ( finfo . position_information . out . position , 1000 ) ;
2006-03-13 01:48:25 +03:00
finfo . position_information . in . file . fnum = fnum2 ;
2004-11-08 04:21:45 +03:00
status = smb_raw_fileinfo ( cli - > tree , mem_ctx , & finfo ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
CHECK_VAL ( finfo . position_information . out . position , 1000 ) ;
smbcli_close ( cli - > tree , fnum1 ) ;
smbcli_close ( cli - > tree , fnum2 ) ;
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " openx twice with RDWR/DENY_NONE \n " ) ;
2004-11-08 04:21:45 +03:00
io . openx . in . open_mode = OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_NONE ;
status = smb_raw_open ( cli - > tree , mem_ctx , & io ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
2006-03-13 01:48:25 +03:00
fnum1 = io . openx . out . file . fnum ;
2004-11-08 04:21:45 +03:00
io . openx . in . open_func = OPENX_OPEN_FUNC_OPEN ;
status = smb_raw_open ( cli - > tree , mem_ctx , & io ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
2006-03-13 01:48:25 +03:00
fnum2 = io . openx . out . file . fnum ;
2004-11-08 04:21:45 +03:00
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " fnum1=%d fnum2=%d \n " , fnum1 , fnum2 ) ;
2004-11-08 04:21:45 +03:00
2006-10-16 17:06:41 +04:00
torture_comment ( tctx , " two handles should be separate \n " ) ;
2004-11-08 04:21:45 +03:00
sfinfo . generic . level = RAW_SFILEINFO_POSITION_INFORMATION ;
2006-03-13 01:48:25 +03:00
sfinfo . position_information . in . file . fnum = fnum1 ;
2004-11-08 04:21:45 +03:00
sfinfo . position_information . in . position = 1000 ;
status = smb_raw_setfileinfo ( cli - > tree , & sfinfo ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
finfo . position_information . level = RAW_FILEINFO_POSITION_INFORMATION ;
2006-03-13 01:48:25 +03:00
finfo . position_information . in . file . fnum = fnum1 ;
2004-11-08 04:21:45 +03:00
status = smb_raw_fileinfo ( cli - > tree , mem_ctx , & finfo ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
CHECK_VAL ( finfo . position_information . out . position , 1000 ) ;
2006-03-13 01:48:25 +03:00
finfo . position_information . in . file . fnum = fnum2 ;
2004-11-08 04:21:45 +03:00
status = smb_raw_fileinfo ( cli - > tree , mem_ctx , & finfo ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
CHECK_VAL ( finfo . position_information . out . position , 0 ) ;
done :
smbcli_close ( cli - > tree , fnum1 ) ;
smbcli_close ( cli - > tree , fnum2 ) ;
smbcli_unlink ( cli - > tree , fname ) ;
return ret ;
}
2009-10-07 03:57:34 +04:00
# define CXD_MATCHES(_cxd, i) \
( ( cxd_known [ i ] . cxd_test = = ( _cxd ) - > cxd_test ) & & \
( cxd_known [ i ] . cxd_flags = = ( _cxd ) - > cxd_flags ) & & \
( cxd_known [ i ] . cxd_access1 = = ( _cxd ) - > cxd_access1 ) & & \
( cxd_known [ i ] . cxd_sharemode1 = = ( _cxd ) - > cxd_sharemode1 ) & & \
( cxd_known [ i ] . cxd_access2 = = ( _cxd ) - > cxd_access2 ) & & \
( cxd_known [ i ] . cxd_sharemode2 = = ( _cxd ) - > cxd_sharemode2 ) )
static int cxd_find_known ( struct createx_data * cxd )
{
static int i = - 1 ;
/* Optimization for tests which we don't have results saved for. */
if ( ( cxd - > cxd_test = = CXD_TEST_CREATEX_ACCESS_EXHAUSTIVE ) | |
( cxd - > cxd_test = = CXD_TEST_CREATEX_SHAREMODE_EXTENDED ) )
return - 1 ;
/* Optimization: If our cxd_known table is too large, it hurts test
* performance to search through the entire table each time . If the
* caller can pass in the previous result , we can try the next entry .
* This works if results are taken directly from the same code . */
i + + ;
if ( ( i > = 0 ) & & ( i < sizeof ( cxd_known ) / sizeof ( cxd_known [ 0 ] ) ) & &
CXD_MATCHES ( cxd , i ) )
return i ;
for ( i = 0 ; i < ( sizeof ( cxd_known ) / sizeof ( cxd_known [ 0 ] ) ) ; i + + ) {
if ( CXD_MATCHES ( cxd , i ) )
return i ;
}
return - 1 ;
}
# define CREATEX_NAME "\\createx_dir"
static bool createx_make_dir ( struct torture_context * tctx ,
struct smbcli_tree * tree , TALLOC_CTX * mem_ctx , const char * fname )
{
bool ret = true ;
NTSTATUS status ;
status = smbcli_mkdir ( tree , fname ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
done :
return ret ;
}
static bool createx_make_file ( struct torture_context * tctx ,
struct smbcli_tree * tree , TALLOC_CTX * mem_ctx , const char * fname )
{
union smb_open open_parms ;
bool ret = true ;
NTSTATUS status ;
2010-03-31 02:18:09 +04:00
ZERO_STRUCT ( open_parms ) ;
open_parms . generic . level = RAW_OPEN_NTCREATEX ;
open_parms . ntcreatex . in . flags = 0 ;
open_parms . ntcreatex . in . access_mask = SEC_RIGHTS_FILE_ALL ;
open_parms . ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
open_parms . ntcreatex . in . share_access = 0 ;
open_parms . ntcreatex . in . open_disposition = NTCREATEX_DISP_CREATE ;
open_parms . ntcreatex . in . create_options = 0 ;
open_parms . ntcreatex . in . fname = fname ;
2009-10-07 03:57:34 +04:00
status = smb_raw_open ( tree , mem_ctx , & open_parms ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
status = smbcli_close ( tree , open_parms . ntcreatex . out . file . fnum ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
done :
return ret ;
}
static void createx_fill_dir ( union smb_open * open_parms , int accessmode ,
int sharemode , const char * fname )
{
2010-03-31 02:18:09 +04:00
ZERO_STRUCTP ( open_parms ) ;
open_parms - > generic . level = RAW_OPEN_NTCREATEX ;
open_parms - > ntcreatex . in . flags = 0 ;
open_parms - > ntcreatex . in . access_mask = accessmode ;
open_parms - > ntcreatex . in . file_attr = FILE_ATTRIBUTE_DIRECTORY ;
open_parms - > ntcreatex . in . share_access = sharemode ;
open_parms - > ntcreatex . in . open_disposition = NTCREATEX_DISP_OPEN_IF ;
open_parms - > ntcreatex . in . create_options = NTCREATEX_OPTIONS_DIRECTORY ;
open_parms - > ntcreatex . in . fname = fname ;
2009-10-07 03:57:34 +04:00
}
static void createx_fill_file ( union smb_open * open_parms , int accessmode ,
int sharemode , const char * fname )
{
2010-03-31 02:18:09 +04:00
ZERO_STRUCTP ( open_parms ) ;
open_parms - > generic . level = RAW_OPEN_NTCREATEX ;
open_parms - > ntcreatex . in . flags = 0 ;
open_parms - > ntcreatex . in . access_mask = accessmode ;
open_parms - > ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
open_parms - > ntcreatex . in . share_access = sharemode ;
open_parms - > ntcreatex . in . open_disposition = NTCREATEX_DISP_OPEN_IF ;
open_parms - > ntcreatex . in . create_options = 0 ;
open_parms - > ntcreatex . in . fname = fname ;
open_parms - > ntcreatex . in . root_fid . fnum = 0 ;
2009-10-07 03:57:34 +04:00
}
static int data_file_fd = - 1 ;
# define KNOWN "known"
# define CHILD "child"
static bool createx_test_dir ( struct torture_context * tctx ,
struct smbcli_tree * tree , int fnum , TALLOC_CTX * mem_ctx , NTSTATUS * result )
{
bool ret = true ;
NTSTATUS status ;
union smb_open open_parms ;
/* bypass original handle to guarantee creation */
2010-03-31 02:18:09 +04:00
ZERO_STRUCT ( open_parms ) ;
open_parms . generic . level = RAW_OPEN_NTCREATEX ;
open_parms . ntcreatex . in . flags = 0 ;
open_parms . ntcreatex . in . access_mask = SEC_RIGHTS_FILE_ALL ;
open_parms . ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
open_parms . ntcreatex . in . share_access = 0 ;
open_parms . ntcreatex . in . open_disposition = NTCREATEX_DISP_CREATE ;
open_parms . ntcreatex . in . create_options = 0 ;
open_parms . ntcreatex . in . fname = CREATEX_NAME " \\ " KNOWN ;
2009-10-07 03:57:34 +04:00
status = smb_raw_open ( tree , mem_ctx , & open_parms ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
smbcli_close ( tree , open_parms . ntcreatex . out . file . fnum ) ;
result [ CXD_DIR_ENUMERATE ] = NT_STATUS_OK ;
/* try to create a child */
2010-03-31 02:18:09 +04:00
ZERO_STRUCT ( open_parms ) ;
open_parms . generic . level = RAW_OPEN_NTCREATEX ;
open_parms . ntcreatex . in . flags = 0 ;
open_parms . ntcreatex . in . access_mask = SEC_RIGHTS_FILE_ALL ;
open_parms . ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
open_parms . ntcreatex . in . share_access = 0 ;
open_parms . ntcreatex . in . open_disposition = NTCREATEX_DISP_CREATE ;
open_parms . ntcreatex . in . create_options = 0 ;
open_parms . ntcreatex . in . fname = CHILD ;
open_parms . ntcreatex . in . root_fid . fnum = fnum ;
2009-10-07 03:57:34 +04:00
result [ CXD_DIR_CREATE_CHILD ] =
smb_raw_open ( tree , mem_ctx , & open_parms ) ;
smbcli_close ( tree , open_parms . ntcreatex . out . file . fnum ) ;
/* try to traverse dir to known good file */
2010-03-31 02:18:09 +04:00
ZERO_STRUCT ( open_parms ) ;
open_parms . generic . level = RAW_OPEN_NTCREATEX ;
open_parms . ntcreatex . in . flags = 0 ;
open_parms . ntcreatex . in . access_mask = SEC_RIGHTS_FILE_ALL ;
open_parms . ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
open_parms . ntcreatex . in . share_access = 0 ;
open_parms . ntcreatex . in . open_disposition = NTCREATEX_DISP_OPEN ;
open_parms . ntcreatex . in . create_options = 0 ;
open_parms . ntcreatex . in . fname = KNOWN ;
open_parms . ntcreatex . in . root_fid . fnum = fnum ;
2009-10-07 03:57:34 +04:00
result [ CXD_DIR_TRAVERSE ] =
smb_raw_open ( tree , mem_ctx , & open_parms ) ;
smbcli_close ( tree , open_parms . ntcreatex . out . file . fnum ) ;
smbcli_unlink ( tree , CREATEX_NAME " \\ " KNOWN ) ;
smbcli_unlink ( tree , CREATEX_NAME " \\ " CHILD ) ;
done :
return ret ;
}
static bool createx_test_file ( struct torture_context * tctx ,
struct smbcli_tree * tree , int fnum , TALLOC_CTX * mem_ctx , NTSTATUS * result )
{
2009-11-07 21:51:47 +03:00
union smb_read rd ;
union smb_write wr ;
2009-10-07 03:57:34 +04:00
char buf [ 256 ] = " " ;
2009-11-07 21:51:47 +03:00
memset ( & rd , 0 , sizeof ( rd ) ) ;
2009-10-07 03:57:34 +04:00
rd . readx . level = RAW_READ_READX ;
rd . readx . in . file . fnum = fnum ;
rd . readx . in . mincnt = sizeof ( buf ) ;
rd . readx . in . maxcnt = sizeof ( buf ) ;
2009-10-15 11:26:19 +04:00
rd . readx . out . data = ( uint8_t * ) buf ;
2004-11-08 04:21:45 +03:00
2009-10-07 03:57:34 +04:00
result [ CXD_FILE_READ ] = smb_raw_read ( tree , & rd ) ;
2009-11-07 21:51:47 +03:00
memset ( & wr , 0 , sizeof ( wr ) ) ;
2009-10-07 03:57:34 +04:00
wr . writex . level = RAW_WRITE_WRITEX ;
wr . writex . in . file . fnum = fnum ;
wr . writex . in . count = sizeof ( buf ) ;
2009-10-15 11:26:19 +04:00
wr . writex . in . data = ( uint8_t * ) buf ;
2009-10-07 03:57:34 +04:00
result [ CXD_FILE_WRITE ] = smb_raw_write ( tree , & wr ) ;
memset ( & rd , 0 , sizeof ( rd ) ) ;
rd . readx . level = RAW_READ_READX ;
rd . readx . in . file . fnum = fnum ;
rd . readx . in . mincnt = sizeof ( buf ) ;
rd . readx . in . maxcnt = sizeof ( buf ) ;
rd . readx . in . read_for_execute = 1 ;
2009-10-15 11:26:19 +04:00
rd . readx . out . data = ( uint8_t * ) buf ;
2009-10-07 03:57:34 +04:00
result [ CXD_FILE_EXECUTE ] = smb_raw_read ( tree , & rd ) ;
return true ;
}
/* TODO When redirecting stdout to a file, the progress bar really screws up
* the output . Could use a switch " --noprogress " , or direct the progress bar to
* stderr ? No other solution ? */
2010-01-05 20:42:54 +03:00
static void createx_progress_bar ( struct torture_context * tctx , unsigned int i ,
unsigned int total , unsigned int skipped )
2009-10-07 03:57:34 +04:00
{
if ( torture_setting_bool ( tctx , " progress " , true ) ) {
torture_comment ( tctx , " %5d/%5d (%d skipped) \r " , i , total ,
skipped ) ;
fflush ( stdout ) ;
}
}
static bool torture_createx_specific ( struct torture_context * tctx , struct
smbcli_state * cli , struct smbcli_state * cli2 , TALLOC_CTX * mem_ctx , struct
createx_data * cxd , int estimated_count )
{
static int call_count = 1 ;
static int unskipped_call_count = 1 ;
const char * fname = CREATEX_NAME ;
int fnum = - 1 , fnum2 = - 1 , res , i ;
union smb_open open_parms1 , open_parms2 ;
bool ret = true ;
bool is_dir = cxd - > cxd_flags & CXD_FLAGS_DIRECTORY ;
NTSTATUS * result = & cxd - > cxd_result [ 0 ] ;
NTSTATUS * result2 = & cxd - > cxd_result2 [ 0 ] ;
bool found = false , failed = false ;
bool ( * make_func ) ( struct torture_context * ,
struct smbcli_tree * , TALLOC_CTX * , const char * ) ;
void ( * fill_func ) ( union smb_open * , int , int , const char * ) ;
bool ( * test_func ) ( struct torture_context * ,
struct smbcli_tree * , int , TALLOC_CTX * , NTSTATUS * ) ;
NTSTATUS ( * destroy_func ) ( struct smbcli_tree * , const char * ) ;
if ( is_dir ) {
make_func = createx_make_dir ;
fill_func = createx_fill_dir ;
test_func = createx_test_dir ;
destroy_func = smbcli_rmdir ;
} else {
make_func = createx_make_file ;
fill_func = createx_fill_file ;
test_func = createx_test_file ;
destroy_func = smbcli_unlink ;
}
2009-10-03 04:02:20 +04:00
/* Skip all SACL related tests. */
if ( ( ! torture_setting_bool ( tctx , " sacl_support " , true ) ) & &
( ( cxd - > cxd_access1 & SEC_FLAG_SYSTEM_SECURITY ) | |
( cxd - > cxd_access2 & SEC_FLAG_SYSTEM_SECURITY ) ) )
goto done ;
2009-10-07 03:57:34 +04:00
if ( cxd - > cxd_flags & CXD_FLAGS_MAKE_BEFORE_CREATEX ) {
ret = make_func ( tctx , cli - > tree , mem_ctx , fname ) ;
if ( ! ret ) {
torture_result ( tctx , TORTURE_FAIL ,
" Initial creation failed \n " ) ;
goto done ;
}
}
/* Initialize. */
fill_func ( & open_parms1 , cxd - > cxd_access1 , cxd - > cxd_sharemode1 , fname ) ;
if ( cxd - > cxd_test = = CXD_TEST_CREATEX_SHAREMODE ) {
fill_func ( & open_parms2 , cxd - > cxd_access2 , cxd - > cxd_sharemode2 ,
fname ) ;
}
for ( i = CXD_CREATEX + 1 ; i < CXD_MAX ; i + + ) {
result [ i ] = NT_STATUS_UNSUCCESSFUL ;
result2 [ i ] = NT_STATUS_UNSUCCESSFUL ;
}
/* Perform open(s). */
result [ CXD_CREATEX ] = smb_raw_open ( cli - > tree , mem_ctx , & open_parms1 ) ;
if ( NT_STATUS_IS_OK ( result [ CXD_CREATEX ] ) ) {
fnum = open_parms1 . ntcreatex . out . file . fnum ;
ret = test_func ( tctx , cli - > tree , fnum , mem_ctx , result ) ;
smbcli_close ( cli - > tree , fnum ) ;
}
if ( cxd - > cxd_test = = CXD_TEST_CREATEX_SHAREMODE ) {
result2 [ CXD_CREATEX ] = smb_raw_open ( cli2 - > tree , mem_ctx ,
& open_parms2 ) ;
if ( NT_STATUS_IS_OK ( result2 [ CXD_CREATEX ] ) ) {
fnum2 = open_parms2 . ntcreatex . out . file . fnum ;
ret = test_func ( tctx , cli2 - > tree , fnum2 , mem_ctx ,
result2 ) ;
smbcli_close ( cli2 - > tree , fnum2 ) ;
}
}
if ( data_file_fd > = 0 ) {
2012-12-10 20:06:39 +04:00
size_t cxd_len = sizeof ( struct createx_data ) ;
2009-10-07 03:57:34 +04:00
found = true ;
2020-10-28 17:05:34 +03:00
res = write ( data_file_fd , cxd , cxd_len ) ;
2012-12-10 20:06:39 +04:00
if ( res ! = cxd_len ) {
2009-10-07 03:57:34 +04:00
torture_result ( tctx , TORTURE_FAIL ,
" (%s): write failed: %s! " ,
__location__ , strerror ( errno ) ) ;
ret = false ;
}
} else if ( ( res = cxd_find_known ( cxd ) ) > = 0 ) {
found = true ;
for ( i = 0 ; i < CXD_MAX ; i + + ) {
/* Note: COMPARE_STATUS will set the "failed" bool. */
COMPARE_STATUS ( result [ i ] , cxd_known [ res ] . cxd_result [ i ] ) ;
if ( i = = 0 & & ! NT_STATUS_IS_OK ( result [ i ] ) )
break ;
if ( cxd - > cxd_test = = CXD_TEST_CREATEX_SHAREMODE ) {
COMPARE_STATUS ( result2 [ i ] ,
cxd_known [ res ] . cxd_result2 [ i ] ) ;
if ( i = = 0 & & ! NT_STATUS_IS_OK ( result2 [ i ] ) )
break ;
}
}
}
/* We print if its not in the "cxd_known" list or if we fail. */
if ( ! found | | failed ) {
torture_comment ( tctx ,
" { .cxd_test = %d, .cxd_flags = %#3x, "
" .cxd_access1 = %#10x, .cxd_sharemode1=%1x, "
" .cxd_access2=%#10x, .cxd_sharemode2=%1x, "
" .cxd_result = { " , cxd - > cxd_test , cxd - > cxd_flags ,
cxd - > cxd_access1 , cxd - > cxd_sharemode1 , cxd - > cxd_access2 ,
cxd - > cxd_sharemode2 ) ;
for ( i = 0 ; i < CXD_MAX ; i + + ) {
torture_comment ( tctx , " %s, " , nt_errstr ( result [ i ] ) ) ;
if ( i = = 0 & & ! NT_STATUS_IS_OK ( result [ i ] ) )
break ;
}
torture_comment ( tctx , " } " ) ;
if ( cxd - > cxd_test = = CXD_TEST_CREATEX_SHAREMODE ) {
torture_comment ( tctx , " , .cxd_result2 = { " ) ;
for ( i = 0 ; i < CXD_MAX ; i + + ) {
torture_comment ( tctx , " %s, " ,
nt_errstr ( result2 [ i ] ) ) ;
if ( i = = 0 & & ! NT_STATUS_IS_OK ( result2 [ i ] ) )
break ;
}
torture_comment ( tctx , " } " ) ;
}
torture_comment ( tctx , " }, \n " ) ;
} else {
createx_progress_bar ( tctx , call_count , estimated_count ,
call_count - unskipped_call_count ) ;
}
/* Count tests that we didn't skip. */
unskipped_call_count + + ;
done :
call_count + + ;
destroy_func ( cli - > tree , fname ) ;
return ret ;
}
uint32_t sec_access_bit_groups [ ] = {
SEC_RIGHTS_FILE_READ ,
SEC_RIGHTS_FILE_WRITE ,
SEC_RIGHTS_FILE_EXECUTE
} ;
# define NUM_ACCESS_GROUPS (sizeof(sec_access_bit_groups) / sizeof(uint32_t))
# define ACCESS_GROUPS_COUNT ((1 << NUM_ACCESS_GROUPS))
# define BITSINBYTE 8
/* Note: See NTCREATEX_SHARE_ACCESS_{NONE,READ,WRITE,DELETE} for share mode
* declarations . */
# define NUM_SHAREMODE_PERMUTATIONS 8
/**
* NTCREATEX and SHARE MODE test .
*
* Open with combinations of ( access_mode , share_mode ) .
* - Check status
* Open 2 nd time with combination of ( access_mode2 , share_mode2 ) .
* - Check status
* Perform operations to verify ?
* - Read
* - Write
* - Delete
*/
bool torture_createx_sharemodes ( struct torture_context * tctx ,
struct smbcli_state * cli ,
struct smbcli_state * cli2 ,
bool dir ,
bool extended )
{
TALLOC_CTX * mem_ctx ;
bool ret = true ;
int i , j , est ;
int gp1 , gp2 ; /* group permuters */
struct createx_data cxd = { 0 } ;
int num_access_bits1 = sizeof ( cxd . cxd_access1 ) * BITSINBYTE ;
int num_access_bits2 = sizeof ( cxd . cxd_access2 ) * BITSINBYTE ;
mem_ctx = talloc_init ( " createx_sharemodes " ) ;
if ( ! mem_ctx )
return false ;
2009-10-03 04:02:20 +04:00
if ( ! torture_setting_bool ( tctx , " sacl_support " , true ) )
torture_warning ( tctx , " Skipping SACL related tests! \n " ) ;
2009-10-07 03:57:34 +04:00
cxd . cxd_test = extended ? CXD_TEST_CREATEX_SHAREMODE_EXTENDED :
CXD_TEST_CREATEX_SHAREMODE ;
cxd . cxd_flags = dir ? CXD_FLAGS_DIRECTORY : 0 ;
/* HACK for progress bar: figure out estimated count. */
est = ( NUM_SHAREMODE_PERMUTATIONS * NUM_SHAREMODE_PERMUTATIONS ) *
( ( ACCESS_GROUPS_COUNT * ACCESS_GROUPS_COUNT ) +
( extended ? num_access_bits1 * num_access_bits2 : 0 ) ) ;
/* Blank slate. */
smbcli_deltree ( cli - > tree , CREATEX_NAME ) ;
smbcli_unlink ( cli - > tree , CREATEX_NAME ) ;
/* Choose 2 random share modes. */
for ( cxd . cxd_sharemode1 = 0 ;
cxd . cxd_sharemode1 < NUM_SHAREMODE_PERMUTATIONS ;
cxd . cxd_sharemode1 + + ) {
for ( cxd . cxd_sharemode2 = 0 ;
cxd . cxd_sharemode2 < NUM_SHAREMODE_PERMUTATIONS ;
cxd . cxd_sharemode2 + + ) {
/* Permutate through our access_bit_groups. */
for ( gp1 = 0 ; gp1 < ACCESS_GROUPS_COUNT ; gp1 + + ) {
for ( gp2 = 0 ; gp2 < ACCESS_GROUPS_COUNT ; gp2 + + )
{
cxd . cxd_access1 = cxd . cxd_access2 = 0 ;
for ( i = 0 ; i < NUM_ACCESS_GROUPS ; i + + )
{
cxd . cxd_access1 | =
( gp1 & ( 1 < < i ) ) ?
sec_access_bit_groups [ i ] : 0 ;
cxd . cxd_access2 | =
( gp2 & ( 1 < < i ) ) ?
sec_access_bit_groups [ i ] : 0 ;
}
torture_createx_specific ( tctx , cli ,
cli2 , mem_ctx , & cxd , est ) ;
}
}
/* Only do the single access bits on an extended run. */
if ( ! extended )
continue ;
for ( i = 0 ; i < num_access_bits1 ; i + + ) {
for ( j = 0 ; j < num_access_bits2 ; j + + ) {
cxd . cxd_access1 = 1ull < < i ;
cxd . cxd_access2 = 1ull < < j ;
torture_createx_specific ( tctx , cli ,
cli2 , mem_ctx , & cxd , est ) ;
}
}
}
}
torture_comment ( tctx , " \n " ) ;
talloc_free ( mem_ctx ) ;
return ret ;
}
bool torture_createx_sharemodes_file ( struct torture_context * tctx ,
struct smbcli_state * cli , struct smbcli_state * cli2 )
{
return torture_createx_sharemodes ( tctx , cli , cli2 , false , false ) ;
}
bool torture_createx_sharemodes_dir ( struct torture_context * tctx ,
struct smbcli_state * cli , struct smbcli_state * cli2 )
{
return torture_createx_sharemodes ( tctx , cli , cli2 , true , false ) ;
}
bool torture_createx_access ( struct torture_context * tctx ,
struct smbcli_state * cli )
{
TALLOC_CTX * mem_ctx ;
bool ret = true ;
uint32_t group_permuter ;
uint32_t i ;
struct createx_data cxd = { 0 } ;
int est ;
int num_access_bits = sizeof ( cxd . cxd_access1 ) * BITSINBYTE ;
mem_ctx = talloc_init ( " createx_dir " ) ;
if ( ! mem_ctx )
return false ;
2009-10-03 04:02:20 +04:00
if ( ! torture_setting_bool ( tctx , " sacl_support " , true ) )
torture_warning ( tctx , " Skipping SACL related tests! \n " ) ;
2009-10-07 03:57:34 +04:00
cxd . cxd_test = CXD_TEST_CREATEX_ACCESS ;
/* HACK for progress bar: figure out estimated count. */
est = CXD_FLAGS_COUNT * ( ACCESS_GROUPS_COUNT + ( num_access_bits * 3 ) ) ;
/* Blank slate. */
smbcli_deltree ( cli - > tree , CREATEX_NAME ) ;
smbcli_unlink ( cli - > tree , CREATEX_NAME ) ;
for ( cxd . cxd_flags = 0 ; cxd . cxd_flags < = CXD_FLAGS_MASK ;
cxd . cxd_flags + + ) {
/**
* This implements a basic permutation of all elements of
* ' bit_group ' . group_permuter is a bit field representing
* which groups to turn on .
*/
for ( group_permuter = 0 ; group_permuter < ( 1 < <
NUM_ACCESS_GROUPS ) ; group_permuter + + ) {
for ( i = 0 , cxd . cxd_access1 = 0 ;
i < NUM_ACCESS_GROUPS ; i + + ) {
cxd . cxd_access1 | = ( group_permuter & ( 1 < < i ) )
? sec_access_bit_groups [ i ] : 0 ;
}
torture_createx_specific ( tctx , cli , NULL , mem_ctx ,
& cxd , est ) ;
}
for ( i = 0 ; i < num_access_bits ; i + + ) {
/* And now run through the single access bits. */
cxd . cxd_access1 = 1 < < i ;
torture_createx_specific ( tctx , cli , NULL , mem_ctx ,
& cxd , est ) ;
/* Does SEC_FLAG_MAXIMUM_ALLOWED override? */
cxd . cxd_access1 | = SEC_FLAG_MAXIMUM_ALLOWED ;
torture_createx_specific ( tctx , cli , NULL , mem_ctx ,
& cxd , est ) ;
/* What about SEC_FLAG_SYSTEM_SECURITY? */
cxd . cxd_access1 | = SEC_FLAG_SYSTEM_SECURITY ;
torture_createx_specific ( tctx , cli , NULL , mem_ctx ,
& cxd , est ) ;
}
}
talloc_free ( mem_ctx ) ;
return ret ;
}
# define ACCESS_KNOWN_MASK 0xF31F01FFull
bool torture_createx_access_exhaustive ( struct torture_context * tctx ,
struct smbcli_state * cli )
{
char * data_file ;
TALLOC_CTX * mem_ctx ;
bool ret = true , first ;
uint32_t i ;
struct createx_data cxd = { 0 } ;
mem_ctx = talloc_init ( " createx_dir " ) ;
if ( ! mem_ctx )
return false ;
2009-10-03 04:02:20 +04:00
if ( ! torture_setting_bool ( tctx , " sacl_support " , true ) )
torture_warning ( tctx , " Skipping SACL related tests! \n " ) ;
2009-10-07 03:57:34 +04:00
data_file = getenv ( " CREATEX_DATA " ) ;
if ( data_file ) {
data_file_fd = open ( data_file , O_WRONLY | O_CREAT | O_TRUNC , 0666 ) ;
if ( data_file_fd < 0 ) {
torture_result ( tctx , TORTURE_FAIL ,
" (%s): data file open failedu: %s! " ,
__location__ , strerror ( errno ) ) ;
ret = false ;
goto done ;
}
}
/* Blank slate. */
smbcli_deltree ( cli - > tree , CREATEX_NAME ) ;
smbcli_unlink ( cli - > tree , CREATEX_NAME ) ;
cxd . cxd_test = CXD_TEST_CREATEX_ACCESS_EXHAUSTIVE ;
for ( cxd . cxd_flags = 0 ; cxd . cxd_flags < = CXD_FLAGS_MASK ;
cxd . cxd_flags + + ) {
for ( i = 0 , first = true ; ( i ! = 0 ) | | first ; first = false ,
i = ( ( i | ~ ACCESS_KNOWN_MASK ) + 1 ) & ACCESS_KNOWN_MASK ) {
cxd . cxd_access1 = i ;
ret = torture_createx_specific ( tctx , cli , NULL ,
mem_ctx , & cxd , 0 ) ;
if ( ! ret )
break ;
}
}
close ( data_file_fd ) ;
data_file_fd = - 1 ;
done :
talloc_free ( mem_ctx ) ;
return ret ;
}
# define MAXIMUM_ALLOWED_FILE "torture_maximum_allowed"
bool torture_maximum_allowed ( struct torture_context * tctx ,
struct smbcli_state * cli )
{
2009-10-16 03:04:26 +04:00
struct security_descriptor * sd , * sd_orig ;
2009-11-07 21:51:47 +03:00
union smb_open io ;
2009-10-07 03:57:34 +04:00
static TALLOC_CTX * mem_ctx ;
int fnum , i ;
bool ret = true ;
NTSTATUS status ;
2009-10-16 03:04:26 +04:00
union smb_fileinfo q ;
const char * owner_sid ;
2012-09-01 01:42:21 +04:00
bool has_restore_privilege , has_backup_privilege , has_system_security_privilege ;
2009-10-07 03:57:34 +04:00
mem_ctx = talloc_init ( " torture_maximum_allowed " ) ;
2009-10-03 04:02:20 +04:00
if ( ! torture_setting_bool ( tctx , " sacl_support " , true ) )
torture_warning ( tctx , " Skipping SACL related tests! \n " ) ;
2009-10-07 03:57:34 +04:00
sd = security_descriptor_dacl_create ( mem_ctx ,
0 , NULL , NULL ,
SID_NT_AUTHENTICATED_USERS ,
SEC_ACE_TYPE_ACCESS_ALLOWED ,
SEC_RIGHTS_FILE_READ ,
0 , NULL ) ;
/* Blank slate */
smbcli_unlink ( cli - > tree , MAXIMUM_ALLOWED_FILE ) ;
/* create initial file with restrictive SD */
2009-11-07 21:51:47 +03:00
memset ( & io , 0 , sizeof ( io ) ) ;
2009-10-07 03:57:34 +04:00
io . generic . level = RAW_OPEN_NTTRANS_CREATE ;
io . ntcreatex . in . access_mask = SEC_RIGHTS_FILE_ALL ;
io . ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
io . ntcreatex . in . open_disposition = NTCREATEX_DISP_CREATE ;
io . ntcreatex . in . impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS ;
io . ntcreatex . in . fname = MAXIMUM_ALLOWED_FILE ;
io . ntcreatex . in . sec_desc = sd ;
status = smb_raw_open ( cli - > tree , mem_ctx , & io ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
fnum = io . ntcreatex . out . file . fnum ;
2009-10-16 03:04:26 +04:00
/* the correct answers for this test depends on whether the
user has restore privileges . To find that out we first need
to know our SID - get it from the owner_sid of the file we
just created */
q . query_secdesc . level = RAW_FILEINFO_SEC_DESC ;
q . query_secdesc . in . file . fnum = fnum ;
q . query_secdesc . in . secinfo_flags = SECINFO_DACL | SECINFO_OWNER ;
status = smb_raw_fileinfo ( cli - > tree , tctx , & q ) ;
CHECK_STATUS ( status , NT_STATUS_OK ) ;
sd_orig = q . query_secdesc . out . sd ;
owner_sid = dom_sid_string ( tctx , sd_orig - > owner_sid ) ;
2009-10-16 11:23:42 +04:00
status = torture_check_privilege ( cli ,
owner_sid ,
sec_privilege_name ( SEC_PRIV_RESTORE ) ) ;
2009-10-16 03:04:26 +04:00
has_restore_privilege = NT_STATUS_IS_OK ( status ) ;
2009-10-16 10:05:48 +04:00
torture_comment ( tctx , " Checked SEC_PRIV_RESTORE for %s - %s \n " ,
owner_sid ,
has_restore_privilege ? " Yes " : " No " ) ;
2009-10-16 03:04:26 +04:00
2009-10-16 11:23:42 +04:00
status = torture_check_privilege ( cli ,
owner_sid ,
sec_privilege_name ( SEC_PRIV_BACKUP ) ) ;
2009-10-16 03:04:26 +04:00
has_backup_privilege = NT_STATUS_IS_OK ( status ) ;
2009-10-16 10:05:48 +04:00
torture_comment ( tctx , " Checked SEC_PRIV_BACKUP for %s - %s \n " ,
owner_sid ,
has_backup_privilege ? " Yes " : " No " ) ;
2009-10-16 03:04:26 +04:00
2012-09-01 01:42:21 +04:00
status = torture_check_privilege ( cli ,
owner_sid ,
sec_privilege_name ( SEC_PRIV_SECURITY ) ) ;
has_system_security_privilege = NT_STATUS_IS_OK ( status ) ;
torture_comment ( tctx , " Checked SEC_PRIV_SECURITY for %s - %s \n " ,
owner_sid ,
has_system_security_privilege ? " Yes " : " No " ) ;
2009-10-07 03:57:34 +04:00
smbcli_close ( cli - > tree , fnum ) ;
for ( i = 0 ; i < 32 ; i + + ) {
uint32_t mask = SEC_FLAG_MAXIMUM_ALLOWED | ( 1u < < i ) ;
2012-09-01 01:42:21 +04:00
/*
* SEC_GENERIC_EXECUTE is a complete subset of
* SEC_GENERIC_READ when mapped to specific bits ,
* so we need to include it in the basic OK mask .
*/
uint32_t ok_mask = SEC_RIGHTS_FILE_READ | SEC_GENERIC_READ | SEC_GENERIC_EXECUTE |
2009-10-16 03:04:26 +04:00
SEC_STD_DELETE | SEC_STD_WRITE_DAC ;
2012-09-01 01:42:21 +04:00
/*
* Now SEC_RIGHTS_PRIV_RESTORE and SEC_RIGHTS_PRIV_BACKUP
* don ' t include any generic bits ( they ' re used directly
* in the fileserver where the generic bits have already
* been mapped into file specific bits ) we need to add the
* generic bits to the ok_mask when we have these privileges .
*/
2009-10-16 03:04:26 +04:00
if ( has_restore_privilege ) {
2012-09-01 01:42:21 +04:00
ok_mask | = SEC_RIGHTS_PRIV_RESTORE | SEC_GENERIC_WRITE ;
2009-10-16 03:04:26 +04:00
}
if ( has_backup_privilege ) {
2012-09-01 01:42:21 +04:00
ok_mask | = SEC_RIGHTS_PRIV_BACKUP | SEC_GENERIC_READ ;
}
if ( has_system_security_privilege ) {
ok_mask | = SEC_FLAG_SYSTEM_SECURITY ;
2009-10-16 03:04:26 +04:00
}
2009-10-07 03:57:34 +04:00
2009-10-03 04:02:20 +04:00
/* Skip all SACL related tests. */
if ( ( ! torture_setting_bool ( tctx , " sacl_support " , true ) ) & &
( mask & SEC_FLAG_SYSTEM_SECURITY ) )
continue ;
2009-10-07 03:57:34 +04:00
memset ( & io , 0 , sizeof ( io ) ) ;
io . generic . level = RAW_OPEN_NTTRANS_CREATE ;
io . ntcreatex . in . access_mask = mask ;
io . ntcreatex . in . file_attr = FILE_ATTRIBUTE_NORMAL ;
io . ntcreatex . in . open_disposition = NTCREATEX_DISP_OPEN ;
io . ntcreatex . in . impersonation =
NTCREATEX_IMPERSONATION_ANONYMOUS ;
io . ntcreatex . in . fname = MAXIMUM_ALLOWED_FILE ;
status = smb_raw_open ( cli - > tree , mem_ctx , & io ) ;
2009-10-16 03:04:26 +04:00
if ( mask & ok_mask | |
mask = = SEC_FLAG_MAXIMUM_ALLOWED ) {
2009-10-07 03:57:34 +04:00
CHECK_STATUS ( status , NT_STATUS_OK ) ;
2009-10-16 03:04:26 +04:00
} else {
if ( mask & SEC_FLAG_SYSTEM_SECURITY ) {
CHECK_STATUS ( status , NT_STATUS_PRIVILEGE_NOT_HELD ) ;
} else {
CHECK_STATUS ( status , NT_STATUS_ACCESS_DENIED ) ;
}
}
2009-10-07 03:57:34 +04:00
fnum = io . ntcreatex . out . file . fnum ;
smbcli_close ( cli - > tree , fnum ) ;
}
done :
2009-10-16 16:04:01 +04:00
smbcli_unlink ( cli - > tree , MAXIMUM_ALLOWED_FILE ) ;
2009-10-07 03:57:34 +04:00
return ret ;
}