unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: Chen Li <chenli@uniontech.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH] shm_open/unlink: fix errno if namelen >= NAME_MAX
Date: Tue, 3 Nov 2020 13:43:21 -0300	[thread overview]
Message-ID: <adbd1e60-256e-6e76-a616-a4cf7dbf3905@linaro.org> (raw)
In-Reply-To: <875z6mlcry.wl-chenli@uniontech.com>



On 03/11/2020 11:45, Chen Li wrote:
> 
> On  Mon Oct 26 19:44:44 GMT 2020,
> Adhemerval Zanella  wrote:
> 
>> I think it would be good to refactor the code to use a PATH_MAX variable
>> instead, something like:
>>
>>  _Bool
>> shm_get_name (const char *prefix, char *shm_name, size shm_path_max)
> 
> So you prefer function over macro here? If so, shm_dir, shm_dirlen, shm_name
> should all be passed as args too, because unlike c macro, function is not
> dynamical scope. Given such long arg list(errno_for_invalid, retval_for_invalid,
> prefix, shm_dir, shm_dirlen, shm_name), I'm not sure weathre it confrom glibc's
> coding style, and is refactoring to split into more small functions a good idea? 

Florian has pointed me out a better solution would be use
use his fix [1] for BZ#25383 [2] which refactor the POSIX sem/shm
code to use a static buffer instead.

Then the ENAMETOOLONG could be returned by '__shm_get_name'
instead.

Florian, do you plan to send your patch for review?

[1] https://sourceware.org/bugzilla/attachment.cgi?id=12921
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=25383

  reply	other threads:[~2020-11-03 16:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  9:14 [PATCH v2 1/3] y2038: Convert cnd_timedwait to support 64 bit time Lukasz Majewski
2020-11-03  9:14 ` [PATCH v2 2/3] y2038: Convert mtx_timedlock " Lukasz Majewski
2020-11-03 14:45   ` [PATCH] shm_open/unlink: fix errno if namelen >= NAME_MAX Chen Li
2020-11-03 16:43     ` Adhemerval Zanella via Libc-alpha [this message]
2020-11-03 16:49       ` Florian Weimer via Libc-alpha
2020-11-03 16:57         ` Adhemerval Zanella via Libc-alpha
2020-11-03 15:28   ` [PATCH v2 2/3] y2038: Convert mtx_timedlock to support 64 bit time Alistair Francis via Libc-alpha
2020-11-11 20:06   ` Adhemerval Zanella via Libc-alpha
2020-11-03  9:14 ` [PATCH v2 3/3] y2038: Convert thrd_sleep " Lukasz Majewski
2020-11-03 15:32   ` Alistair Francis via Libc-alpha
2020-11-11 20:08   ` Adhemerval Zanella via Libc-alpha
2020-11-03 15:24 ` [PATCH v2 1/3] y2038: Convert cnd_timedwait " Alistair Francis via Libc-alpha
2020-11-11 20:05 ` Adhemerval Zanella via Libc-alpha
  -- strict thread matches above, loose matches on Subject: below --
2020-10-16 10:09 [PATCH] shm_open/unlink: fix errno if namelen >= NAME_MAX Chen Li
2020-10-26 19:44 ` Adhemerval Zanella via Libc-alpha
2020-10-27 10:27   ` Florian Weimer via Libc-alpha
2020-10-27 11:53     ` Adhemerval Zanella via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=adbd1e60-256e-6e76-a616-a4cf7dbf3905@linaro.org \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=chenli@uniontech.com \
    --cc=fweimer@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).