[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: strlcpy and strlcat in linux libc ?



On Mon, Mar 04, 2002 at 11:09:50PM +1100, Jean-Francois Dive wrote:
> I am working at the moment on some port from openBSD to debian, and discovered that
> they use this strlcpy|cat (security enhanced version of strNcpy|cat). Does someone
> know if there are any plan or a place to get those included in the standard version
> of the libc ?

While everyone else is busy making their final judgement with the glibc
maintainers, let me help you out here.

Any portable application must include an implementation of strlcat/strlcpy
if they are going to use it, as those two are not part of any standard.  So
just c&p the functions from BSD, add an autoconf check for them, and forget
about it.

I would understand your question as "when will those functions be part of
POSIX" (as you asked when they will be part of "standard libc"), and we
don't know.  When they will be, they will certainly also be part of glibc.
Until then, deal with it as with any other non-standard function.

I will resist to add my own comment about the usability of these functions. 
They exist, and the above way is the right thing to deal with them
currently.

If the maintainer of the above programs refuse to make their programs
portable, then you are stuck, of course.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de



Reply to: