[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241109120118.GA1805018@mit.edu>
Date: Sat, 9 Nov 2024 07:01:18 -0500
From: "Theodore Ts'o" <tytso@....edu>
To: Sebastian Feld <sebastian.n.feld@...il.com>
Cc: open list <linux-kernel@...r.kernel.org>,
Linux NFS Mailing List <linux-nfs@...r.kernel.org>
Subject: Re: Kernel strscpy() should be renamed to kstrscpy() Re: [PATCH]
nfs_sysfs_link_rpc_client(): Replace strcpy with strscpy
On Sat, Nov 09, 2024 at 12:11:02PM +0100, Sebastian Feld wrote:
> > > How should the "bounds checking" work in this case if you only pass
> > > two arguments ?
> >
> > The linux kernel strscpy() checks the sizeof the destination.
>
> Then the kernel strscpy() should be renamed accordingly, and not
> confuse people. Suggested name would be kstrscpy().
> Otherwise this would disqualify strscpy() ever from being adopted as a
> POSIX standard, as there are two - kernel and glibc - conflicting
> implementations
If POSIX decided that this meant they couldn't adopt strscpy(), that
is ANSI / ISO's problem, not ours. Note that strscpy() supports the 3
argument version of glibc, and POSIX has always been willing to
standardize a subset of a particullar interface.
Otherwise, any Legacy Unix system which added some one or more flags
to some particular interface could potentially disqualify anything
with the same name of that interface from ever being standardized,
which is (a) stupid, and (b) not what has been done in historical
practice.
- Ted
Powered by blists - more mailing lists