From: Joe Simmons-Talbott <josimmon@redhat.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH v10] posix: Deprecate group_member for Linux
Date: Wed, 27 Mar 2024 14:45:31 -0400 [thread overview]
Message-ID: <CAAQBMsOKK2ua-aXULuEdnabH0vya0846EFSuhLxfjSJqD0DyGg@mail.gmail.com> (raw)
In-Reply-To: <c753d370-cae8-4e72-ad82-9a733b2b93af@cs.ucla.edu>
On Wed, Mar 27, 2024 at 12:24 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
>
> On 3/27/24 06:00, Joe Simmons-Talbott wrote:
> > + int gm = __group_member2 (stats.st_gid);
> > + if (stats.st_gid == ((flag & AT_EACCESS)
> > + ? __getegid ()
> > + : __getgid ()) || (gm && gm != -1))
> > + granted = (unsigned int) (stats.st_mode & (mode << 3)) >> 3;
> > + else if (gm == -1)
> > + return -1;
>
> This is not best, as it calls __group_member2 even when (stats.st_gid ==
> (flag & AT_EACCESS ? __getegid () : __getgid ())) and there is no need
> for the __group_member2 overhead in that case. The old code didn't have
> this problem.
>
Indeed. I've posted a v11[1].
Thanks,
Joe
[1] https://sourceware.org/pipermail/libc-alpha/2024-March/155633.html
--
Joe Simmons-Talbott
prev parent reply other threads:[~2024-03-27 18:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 12:00 [PATCH v10] posix: Deprecate group_member for Linux Joe Simmons-Talbott
2024-03-27 16:24 ` Paul Eggert
2024-03-27 18:45 ` Joe Simmons-Talbott [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
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=CAAQBMsOKK2ua-aXULuEdnabH0vya0846EFSuhLxfjSJqD0DyGg@mail.gmail.com \
--to=josimmon@redhat.com \
--cc=eggert@cs.ucla.edu \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/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).