Bug 468807 - The function _nss_ldap_gethostbyname_r doen't set the proper return value and errno_p when the length of name is less than required
Summary: The function _nss_ldap_gethostbyname_r doen't set the proper return value and...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nss_ldap
Version: 5.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Nalin Dahyabhai
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-28 05:42 UTC by Jason Luo
Modified: 2011-01-13 23:31 UTC (History)
3 users (show)

Fixed In Version: nss_ldap-253-27.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-13 23:31:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
nss_ldap-253-errnop.patch (353 bytes, patch)
2008-10-28 05:42 UTC, Jason Luo
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0097 0 normal SHIPPED_LIVE nss_ldap bug fix update 2011-01-12 17:29:13 UTC

Description Jason Luo 2008-10-28 05:42:01 UTC
Created attachment 321677 [details]
nss_ldap-253-errnop.patch

let's look at the prototype of some related functions:

NSS_STATUS
_nss_ldap_gethostbyname_r (const char *name, struct hostent * result,
                           char *buffer, size_t buflen, int *errnop,
                           int *h_errnop)

struct hostent *gethostbyname2(const char *name, int af)

int gethostbyname2_r(const char *name, int af,
         struct hostent *ret, char *buf, size_t buflen,
         struct hostent **result, int *h_errnop);

we assume that we get hosts from ldap server.

gethostbyname2 call gethostbyname2_r to get the hosts from ldap_server, the
default size of name(the first parameter of function gethostbyname2) is 1024.
If the size is not enough,  gethostbyname2 require gethostbyname2_r to return
the errno as the return value , set the proper value of h_errnop , then
gethostbyname2 will double the size of name and call gethostbyname2_r again. 
but, the function called by gethostbyname2 doesn't follow the restriction. in
nss_ldap, the related function is _nss_ldap_gethostbyname_r.

Comment 1 Jason Luo 2008-10-28 05:55:19 UTC
upstream Bugzilla:
http://bugzilla.padl.com/show_bug.cgi?id=378

Comment 8 errata-xmlrpc 2011-01-13 23:31:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0097.html


Note You need to log in before you can comment on or make changes to this bug.