public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Sebastian Feld <sebastian.n.feld@gmail.com>
Cc: open list <linux-kernel@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: Kernel strscpy() should be renamed to kstrscpy() Re: [PATCH] nfs_sysfs_link_rpc_client(): Replace strcpy with strscpy
Date: Sat, 9 Nov 2024 07:01:18 -0500	[thread overview]
Message-ID: <20241109120118.GA1805018@mit.edu> (raw)
In-Reply-To: <CAHnbEGKRKrw-9_wnrASVHniZ1RggP+b-YzvwPYM7ScsMvmpCGA@mail.gmail.com>

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


      parent reply	other threads:[~2024-11-09 12:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06  2:49 [PATCH] nfs_sysfs_link_rpc_client(): Replace strcpy with strscpy Daniel Yang
2024-11-06 19:30 ` Benjamin Coddington
2024-11-06 20:20 ` Roland Mainz
2024-11-06 20:40   ` Benjamin Coddington
2024-11-09 11:11     ` Kernel strscpy() should be renamed to kstrscpy() " Sebastian Feld
2024-11-09 11:28       ` Benjamin Coddington
2024-11-09 12:01       ` Theodore Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241109120118.GA1805018@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=sebastian.n.feld@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox