BUG: Wide Links - does not work as documented

Elrond Elrond at Wunder-Nett.org
Fri Apr 14 12:26:28 GMT 2000

On Fri, Apr 14, 2000 at 01:23:46AM +1000, Jani Jaakkola wrote:
> 1. chdir() to the directory of the file to be opened
> 2. check with getcwd() that directory is the same directory as the 
>    directory we chdir():red to

You have to note, that the share itself might be in a
symlinked directory. That is:

  path = /directory_full_of_symlinks/sharename

One possible solution would be to call realpath on the
sharepath too.

> 3. open the basename of the file with O_NOFOLLOW given to open.

(you already described the right portable solution in your
other mail)

> If "wide links = no":
> 1. find out the real file name with realpath().
> 2. check that the real file name is under the share directory

(see above)

> 3. open the real file name just like when "follow symlinks=no" is set.
> - Jani


More information about the samba-technical mailing list