Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Dec 2000 06:52:48 -0700
From:      Warner Losh <imp@village.org>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        des@ofug.org (Dag-Erling Smorgrav), assar@FreeBSD.ORG, dillon@earth.backplane.com (Matt Dillon), kris@citusc.usc.edu, arch@FreeBSD.ORG
Subject:   Re: Safe string formatting in the kernel 
Message-ID:  <200012131352.GAA38352@harmony.village.org>
In-Reply-To: Your message of "Wed, 13 Dec 2000 08:42:53 GMT." <200012130842.BAA26666@usr08.primenet.com> 
References:  <200012130842.BAA26666@usr08.primenet.com>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200012130842.BAA26666@usr08.primenet.com> Terry Lambert writes:
: > Just be careful that your dynamic string growing things don't violate
: > the hard limit invariants in the kernel.  If it produces paths longer
: > than 1023 characters, for example, it is wrong.
: 
: Actually, this is rather broken already in the symlink following
: code in the lookup code, since it expands links in place with
: the rest of the path components, instead of properly traversing
: them.  So the limit there is less than 1023 for some intermediate
: component of a path being a (large) symlink.

Yes, but....  The longest path that you can give the kernel or get
from the kernel is 1023.  If the path happens to expand longer due to
symlinks, or concatination with pwd, that's OK.  I don't think that
the kernel constructs a full path like this internally as a string,
however.

The point is that there are some things that other things expect to be 
a fixed length and if you go around violating that you are in for
trouble.

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012131352.GAA38352>