Are paths passed to VFS funcs normalized?

Jeremy Allison jra at samba.org
Mon Oct 27 14:09:44 MDT 2014


On Sat, Oct 25, 2014 at 09:53:47AM +0200, Ralph Böhme wrote:
> Hi,
> 
> are paths guaranteed to be normalized when passed to VFS functions
> like SMB_VFS_MKDIR() (besides possibly beginning with "./") ?

Yes, check_path_syntax_internal() in source3/smbd/reply.c
cuts out any ../ and ./ entries so they shouldn't exist
inside smbd.

> I'm currently working on fixing up a 3rd party VFS module that goes
> great length towards catching "/.." and stuff in paths.

The only thing that can re-introduce this is via
a symlink, but smbd does not follow call readlink
other than for MSDFS or returning a link path to
the client, so that should never be seen internally.

We follow the link, but never see the link path
we followed.

If either widelinks or follow symlinks are disallowed,
we use realpath to remove link artifacts.


More information about the samba-technical mailing list