[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug report



> % mkdir fubar
> % ls -ld fubar
> drwxr-x--x   2 guest    user          192 Mar 15 23:05 fubar
> % chmod u-r fubar
> % ls -ld fubar
> d-wxr-x--x   2 guest    user          192 Mar 15 23:05 fubar
> % cd fubar
> fubar: access denied.
> 
> According to existing UNIX standards, if a user is denied read access to a
> directory, but the "search/execute" bit it set the user may enter the
> directory and any of its subdirectories but not read any information of
> the directory (ie. ls:ing the contents will produce access denied or no
> results or something similar). Also, the user may copy and access files
> and subdirectories inside the directory as directory permission bits don't
> affect the files it contains. 
> 
> In the example above, copying to and from the directory worked fine, but I
> could not change my current working directory to it, which is not correct.

Here's what i found in D_setpath() in module dosdir.c:

	if (denyaccess(&xattr, S_IROTH|S_IXOTH)) {
		DEBUG(("Dsetpath(%s): access denied", path));
		release_cookie(&dir);
		return EACCDN;
	}

>From what I actually understand, the fragment above checks for r and x
attributes, then allows to set a new path if both attributes are set
(r-x). If one of them is not set, EACCDN is returned.

To get it working correctly it is probably enough to change the first
line to:

	if (denyaccess(&xattr, S_IXOTH)) {

Gtx,

Konrad M.Kokoszkiewicz
mail:draco@bl.pg.gda.pl
http://www.orient.uw.edu.pl/~conradus/

** Quem Iuppiter vult perdere, dementat prius.
*******************************************************
** Kogo Jowisz chce zgubic, temu wpierw rozum odbiera.