diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2006-03-22 16:40:03 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2006-03-22 16:40:03 +0000 |
commit | 7ec7c93b1895442f91f42eb78a2c77ca31b7b8d8 (patch) | |
tree | f2f677119f6e5ae9bb59afb38a21beeb680e5dce /contrib/sendmail/libsm/ldap.c | |
parent | e66460b8942afc349793d018627b403bbd4eaad0 (diff) | |
parent | ef9770707c0f88e94a0c4a409f8fb74cea250716 (diff) | |
download | FreeBSD-src-7ec7c93b1895442f91f42eb78a2c77ca31b7b8d8.zip FreeBSD-src-7ec7c93b1895442f91f42eb78a2c77ca31b7b8d8.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r157001,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/sendmail/libsm/ldap.c')
-rw-r--r-- | contrib/sendmail/libsm/ldap.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/contrib/sendmail/libsm/ldap.c b/contrib/sendmail/libsm/ldap.c index 3af7ffa..76e91b3 100644 --- a/contrib/sendmail/libsm/ldap.c +++ b/contrib/sendmail/libsm/ldap.c @@ -8,7 +8,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: ldap.c,v 1.62 2005/02/24 00:30:01 ca Exp $") +SM_RCSID("@(#)$Id: ldap.c,v 1.67 2005/12/14 00:08:03 ca Exp $") #if LDAPMAP # include <sys/types.h> @@ -47,6 +47,18 @@ static SM_LDAP_RECURSE_ENTRY *sm_ldap_add_recurse __P((SM_LDAP_RECURSE_LIST **, ** */ +#if _FFR_LDAP_VERSION +# if defined(LDAP_VERSION_MAX) && _FFR_LDAP_VERSION > LDAP_VERSION_MAX + ERROR FFR_LDAP_VERSION > _LDAP_VERSION_MAX +# endif /* defined(LDAP_VERSION_MAX) && _FFR_LDAP_VERSION > LDAP_VERSION_MAX */ +# if defined(LDAP_VERSION_MIN) && _FFR_LDAP_VERSION < LDAP_VERSION_MIN + ERROR FFR_LDAP_VERSION < _LDAP_VERSION_MIN +# endif /* defined(LDAP_VERSION_MIN) && _FFR_LDAP_VERSION < LDAP_VERSION_MIN */ +# define SM_LDAP_VERSION_DEFAULT _FFR_LDAP_VERSION +#else /* _FFR_LDAP_VERSION */ +# define SM_LDAP_VERSION_DEFAULT 0 +#endif /* _FFR_LDAP_VERSION */ + void sm_ldap_clear(lmap) SM_LDAP_STRUCT *lmap; @@ -57,7 +69,7 @@ sm_ldap_clear(lmap) lmap->ldap_host = NULL; lmap->ldap_port = LDAP_PORT; lmap->ldap_uri = NULL; - lmap->ldap_version = 0; + lmap->ldap_version = SM_LDAP_VERSION_DEFAULT; lmap->ldap_deref = LDAP_DEREF_NEVER; lmap->ldap_timelimit = LDAP_NO_LIMIT; lmap->ldap_sizelimit = LDAP_NO_LIMIT; @@ -615,6 +627,16 @@ sm_ldap_results(lmap, msgid, flags, delim, rpool, result, continue; } +#if _FFR_LDAP_SINGLEDN + if (bitset(SM_LDAP_SINGLEDN, flags) && *result != NULL) + { + /* only wanted one match */ + SM_LDAP_ERROR_CLEANUP(); + errno = ENOENT; + return EX_NOTFOUND; + } +#endif /* _FFR_LDAP_SINGLEDN */ + /* record completed DN's to prevent loops */ dn = ldap_get_dn(lmap->ldap_ld, entry); if (dn == NULL) |