Bug 5213 - Threads: Avoid gethostbyname()
Summary: Threads: Avoid gethostbyname()
Status: NEW
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Andrew Bartlett
URL:
Keywords:
Depends on:
Blocks: 6358
  Show dependency treegraph
 
Reported: 2008-01-19 11:01 UTC by Jelmer Vernooij
Modified: 2024-10-17 22:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jelmer Vernooij 2008-01-19 11:01:57 UTC
We still use the thread-unsafe gethostbyname() function in several places. We should be using 
gethostbyname_r or getaddrinfo() instead.

lib/replace/getaddrinfo.c:	return canon_name_from_hostent(gethostbyname(name), perr);
lib/replace/getaddrinfo.c:	hp = gethostbyname(node);
lib/socket/socket_ip.c:	he = gethostbyname2(name, PF_INET6);
lib/util/system.c:		return(gethostbyname(name));
lib/util/system.c:		return(gethostbyname(name));
lib/util/system.c:		return(gethostbyname(name));
lib/util/system.c:	return(gethostbyname(query));
lib/util/system.c:	return(gethostbyname(name));
Comment 1 Douglas Bagnall 2024-10-17 22:37:33 UTC
Outside of third_party/ and */examples/ we now have:

ctdb/ib/ibw_ctdb.c:             struct hostent *he = gethostbyname(address);
ctdb/ib/ibwrapper_test.c:               struct hostent *he = gethostbyname(address);
lib/replace/getaddrinfo.c:      return canon_name_from_hostent(gethostbyname(name), perr);
lib/replace/getaddrinfo.c:      hp = gethostbyname(node);