BUG: Wide Links - does not work as documented

Jani Jaakkola jjaakkol at cs.helsinki.fi
Thu Apr 13 18:53:35 GMT 2000

On Thu, 13 Apr 2000, Jeremy Allison wrote:

> Not at all portable I'm afraid.

Right. So for systems which do not have O_NOFOLLOW:

1. lstat() the filename. If it is a symlink, return failure
2. open the file (without O_NOFOLLOW)
3. fstat() the filedescriptor returned by open.
4. If the fstat() and lstat() did not agree (they did not point to same
   inode), we had a race condition situation. Close the
   already opened file and return failure. 

That will be a lot of syscalls and complexity for a simple thing. Symlinks
and security don't mix well :(

Does anybody know a better way to do the same thing?

Is there anybody else besides me, who would need a feature like this?

- Jani

More information about the samba-technical mailing list