Are paths passed to VFS funcs normalized?

Jeremy Allison jra at samba.org
Mon Oct 27 15:20:33 MDT 2014


On Mon, Oct 27, 2014 at 09:16:52PM +0100, Ralph Böhme wrote:
> Hi Jeremy,
> 
> On Mon, Oct 27, 2014 at 01:09:44PM -0700, Jeremy Allison wrote:
> > On Sat, Oct 25, 2014 at 09:53:47AM +0200, Ralph Böhme wrote:
> > > 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.
> 
> thanks! While I came across the check_path functions later on while
> going through the code, it seemed the semantics are that it's up to
> each specifc SMB(1/2/3) function whether it makes use of it or not. I
> checked trans2/findfirst which does use it, but then got distracted by
> other fun stuff like waf bugs. ;)

It should always be used to pull paths out of
incoming buffers (except for one posix pathnames
symlinks case which is too complex to go into now :-).


More information about the samba-technical mailing list