mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Hans Harder <hans@atbas.org>
To: musl@lists.openwall.com
Subject: [musl] hostname is using a case sensitive search in function name_from_hosts
Date: Thu, 9 Jun 2022 20:42:28 +0200	[thread overview]
Message-ID: <CAKzsc6d0QSFxQKeGjQETz3QkPEkBwePZe+8scKA1p9RcB8f=8g@mail.gmail.com> (raw)

Hi,
I discovered that the function name_from_hosts parses the /etc/hosts
file and does a case sensitive search for a name.
Sometimes I encounter mixed upper and lowercase hostnames in a /etc/hosts file.
It would be easier if the function searches for the name in a case
insensitive way....

By changing line 68  in src/network/lookup_name.c
       for(p=line+1; (p=strstr(p, name)) &&
to:
       for(p=line+1; (p=strcasestr(p, name)) &&

That would resolve the problem.

Hans

             reply	other threads:[~2022-06-09 18:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 18:42 Hans Harder [this message]
2022-06-09 20:34 ` Rich Felker
2022-06-15  6:30   ` Hans Harder
2022-06-16 16:19   ` NRK
2022-06-16 16:45     ` Rich Felker

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='CAKzsc6d0QSFxQKeGjQETz3QkPEkBwePZe+8scKA1p9RcB8f=8g@mail.gmail.com' \
    --to=hans@atbas.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).