mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] hostname is using a case sensitive search in function name_from_hosts
@ 2022-06-09 18:42 Hans Harder
  2022-06-09 20:34 ` Rich Felker
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Harder @ 2022-06-09 18:42 UTC (permalink / raw)
  To: musl

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-16 16:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 18:42 [musl] hostname is using a case sensitive search in function name_from_hosts Hans Harder
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

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).