diff options
author | sdussud <none@none> | 2005-08-29 00:02:55 -0700 |
---|---|---|
committer | sdussud <none@none> | 2005-08-29 00:02:55 -0700 |
commit | 7d575517b5507fdeb4abc67fcf56630fd49fc369 (patch) | |
tree | 14108facd10f888fc4f2ffab8494b9efd8015739 /usr/src/lib/libldap5/sources/ldap | |
parent | 3f9207dc30b6a3a60ed15183a8c6de02cafe3073 (diff) | |
download | illumos-gate-7d575517b5507fdeb4abc67fcf56630fd49fc369.tar.gz |
6226776 The passwd command will fail if first ldap server in referral list is down.
6276525 libldap5 cores when trying to resolve hostname
Diffstat (limited to 'usr/src/lib/libldap5/sources/ldap')
-rw-r--r-- | usr/src/lib/libldap5/sources/ldap/prldap/ldappr-dns.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/src/lib/libldap5/sources/ldap/prldap/ldappr-dns.c b/usr/src/lib/libldap5/sources/ldap/prldap/ldappr-dns.c index 7c49225109..6c84a6f423 100644 --- a/usr/src/lib/libldap5/sources/ldap/prldap/ldappr-dns.c +++ b/usr/src/lib/libldap5/sources/ldap/prldap/ldappr-dns.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -302,17 +302,18 @@ prldap_initf_hosts(nss_db_params_t *p) * prldap_gethostbyname1() and prldap_x_install_dns_skipdb(). * * Returns: - * Valid pointer to hostent if success + * PR_SUCCESS if success * PR_FAILURE if failure */ -static struct hostent * +static int prldap_switch_gethostbyname_r(const char *name, struct hostent *result, char *buffer, int buflen, int *h_errnop) { nss_XbyY_args_t arg; nss_status_t res; + struct hostent *resp; /* * Log the information indicating that we are trying to @@ -329,7 +330,9 @@ prldap_switch_gethostbyname_r(const char *name, NSS_DBOP_HOSTS_BYNAME, &arg); arg.status = res; *h_errnop = arg.h_errno; - return (struct hostent *)NSS_XbyY_FINI(&arg); + resp = (struct hostent *)NSS_XbyY_FINI(&arg); + + return (resp != NULL ? PR_SUCCESS : PR_FAILURE); } /* @@ -348,6 +351,7 @@ prldap_gethostbyname1(const char *name, LDAPHostEnt *result, int h_errno; LDAPHostEnt prhent; + memset(&prhent, '\0', sizeof (prhent)); if (!statusp || ( *statusp = prldap_switch_gethostbyname_r(name, &prhent, buffer, buflen, &h_errno )) == PR_FAILURE) { /* |