access_table() challenge - win a Samba t-shirt!

Luke Kenneth Casson Leighton lkcl at samba.org
Mon Jan 17 16:10:40 GMT 2000


On Tue, 18 Jan 2000, Matt Chapman wrote:

> On Mon, Jan 17, 2000 at 12:30:39AM +1100, Andrew Tridgell wrote:
> > I've just spent quite some time re-doing our deny mode code in
> > Samba. We now pass (ie. match NT4) on all possible deny mode
> > combinations.
> 
> I don't know if you are getting different results for one reason or another,
> but against my NT4 (SP6) server the results for the standard deny modes are 
> just what one would expect. So, for those modes we can simply write:
> 
> static BOOL test_compatibility(int deny, int mode)
> {
> 	switch (deny) {
> 		case DENY_ALL:
> 			return 0;
> 		case DENY_NONE:
> 			return 1;
> 		case DENY_READ:
> 			return (mode == DOS_OPEN_WRONLY);
> 		case DENY_WRITE:
> 			return (mode == DOS_OPEN_RDONLY);
> 	}
> }

static BOOL test_compatibility(int access_requested, int
access_not_allowed)
{
	return (access_requested & access_not_allowed == 0);
}



More information about the samba-technical mailing list