diff options
author | John Beck <John.Beck@Sun.COM> | 2010-01-06 13:22:51 -0800 |
---|---|---|
committer | John Beck <John.Beck@Sun.COM> | 2010-01-06 13:22:51 -0800 |
commit | e9af4bc0b1cc30cea75d6ad4aa2fde97d985e9be (patch) | |
tree | 6a7ad97561f2580625546f56c063c89ebb3b92dd /usr/src/cmd/sendmail/libsm/mbdb.c | |
parent | 5f8171005a0c33f3c67f7da52d41c2362c3fd891 (diff) | |
download | illumos-joyent-e9af4bc0b1cc30cea75d6ad4aa2fde97d985e9be.tar.gz |
6913961 upgrade sendmail to 8.14.4
6790772 Array overrun in sendmail
Diffstat (limited to 'usr/src/cmd/sendmail/libsm/mbdb.c')
-rw-r--r-- | usr/src/cmd/sendmail/libsm/mbdb.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/usr/src/cmd/sendmail/libsm/mbdb.c b/usr/src/cmd/sendmail/libsm/mbdb.c index d1a66d5894..3bb514df51 100644 --- a/usr/src/cmd/sendmail/libsm/mbdb.c +++ b/usr/src/cmd/sendmail/libsm/mbdb.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2002 Sendmail, Inc. and its suppliers. + * Copyright (c) 2001-2003,2009 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -7,10 +7,8 @@ * the sendmail distribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sm/gen.h> -SM_RCSID("@(#)$Id: mbdb.c,v 1.40 2003/12/10 03:19:07 gshapiro Exp $") +SM_RCSID("@(#)$Id: mbdb.c,v 1.41 2009/06/19 22:02:26 guenther Exp $") #include <sys/param.h> @@ -566,7 +564,20 @@ mbdb_ldap_lookup(name, user) entry = ldap_first_entry(LDAPLMAP.ldap_ld, LDAPLMAP.ldap_res); if (entry == NULL) { - save_errno = sm_ldap_geterrno(LDAPLMAP.ldap_ld); + int rc; + + /* + ** We may have gotten an LDAP_RES_SEARCH_RESULT response + ** with an error inside it, so we have to extract that + ** with ldap_parse_result(). This can happen when talking + ** to an LDAP proxy whose backend has gone down. + */ + + save_errno = ldap_parse_result(LDAPLMAP.ldap_ld, + LDAPLMAP.ldap_res, &rc, NULL, + NULL, NULL, NULL, 0); + if (save_errno == LDAP_SUCCESS) + save_errno = rc; if (save_errno == LDAP_SUCCESS) { errno = ENOENT; |