public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: libc-alpha@sourceware.org
Subject: Re: v5 [PATCH 6/6] nsswitch: use new internal API (callers)
Date: Wed, 17 Feb 2021 16:15:47 -0500	[thread overview]
Message-ID: <xn4kia8kfw.fsf@greed.delorie.com> (raw)
In-Reply-To: <87k0r6jt9w.fsf@igel.home> (message from Andreas Schwab on Wed, 17 Feb 2021 22:09:31 +0100)

Andreas Schwab <schwab@linux-m68k.org> writes:
> On Feb 17 2021, DJ Delorie wrote:
>
>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>
>>> On Feb 17 2021, DJ Delorie wrote:
>>>
>>>> +  /* Neither found, use default config.  */
>>>> +  *ni = __nss_action_parse (defconfig);
>>>> +  if (*ni != NULL)
>>>> +    return 0;
>>>> +
>>>> +  /* Failure.  */
>>>> +  return -1;
>>>
>>> How can that ever be reached?
>>
>> Passing a syntactically incorrect string as defconfig, or memory
>> allocation failure.
>
> defconfig isn't used before that point.

*ni = __nss_action_parse (defconfig);

If defconfig is syntactically invalid, __nss_action_parse can't parse
it, and returns NULL.

If parsing defconfig requires allocating memory, and the allocation
fails, __nss_action_parse returns NULL.

If either of these cases happens, we report failure by returning -1.

Either that or I'm totally misunderstanding what you're asking.  Which
"that" are you asking how it can be reached?

If you're refering to the "Neither found" comment, it reaches that if
nsswitch.conf mentions neither the primary nor alternate service name.


  reply	other threads:[~2021-02-17 21:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 20:34 DJ Delorie
2020-12-04  3:29 ` Siddhesh Poyarekar
2021-02-15 15:42   ` Andreas Schwab
2021-02-16  2:36     ` DJ Delorie
2021-02-16  8:38       ` Andreas Schwab
2021-02-17  5:42         ` DJ Delorie
2021-02-17 13:27           ` Andreas Schwab
2021-02-17 20:44             ` DJ Delorie
2021-02-17 21:09               ` Andreas Schwab
2021-02-17 21:15                 ` DJ Delorie [this message]
2021-02-17 22:31                   ` Andreas Schwab
2021-02-17 22:51                     ` DJ Delorie
2021-02-17 23:23                       ` Andreas Schwab
2021-02-18  4:55                         ` DJ Delorie
2021-02-18  8:43                           ` Andreas Schwab

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=xn4kia8kfw.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.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).