summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/include/sm/ldap.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/include/sm/ldap.h')
-rw-r--r--contrib/sendmail/include/sm/ldap.h53
1 files changed, 40 insertions, 13 deletions
diff --git a/contrib/sendmail/include/sm/ldap.h b/contrib/sendmail/include/sm/ldap.h
index 7deec8b..dfa0463 100644
--- a/contrib/sendmail/include/sm/ldap.h
+++ b/contrib/sendmail/include/sm/ldap.h
@@ -6,7 +6,7 @@
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
- * $Id: ldap.h,v 1.9 2002/01/11 22:06:50 gshapiro Exp $
+ * $Id: ldap.h,v 1.22 2002/03/05 02:17:26 ca Exp $
*/
#ifndef SM_LDAP_H
@@ -15,6 +15,11 @@
# include <sm/conf.h>
# include <sm/rpool.h>
+/*
+** NOTE: These should be changed from LDAPMAP_* to SM_LDAP_*
+** in the next major release (8.13) of sendmail.
+*/
+
# ifndef LDAPMAP_MAX_ATTR
# define LDAPMAP_MAX_ATTR 64
# endif /* ! LDAPMAP_MAX_ATTR */
@@ -30,22 +35,31 @@
# if _FFR_LDAP_RECURSION
/* Attribute types */
-# define LDAPMAP_ATTR_NORMAL 0
-# define LDAPMAP_ATTR_DN 1
-# define LDAPMAP_ATTR_FILTER 2
-# define LDAPMAP_ATTR_URL 3
-# define LDAPMAP_ATTR_FINAL 4
+# define SM_LDAP_ATTR_NONE (-1)
+# define SM_LDAP_ATTR_OBJCLASS 0
+# define SM_LDAP_ATTR_NORMAL 1
+# define SM_LDAP_ATTR_DN 2
+# define SM_LDAP_ATTR_FILTER 3
+# define SM_LDAP_ATTR_URL 4
/* sm_ldap_results() flags */
# define SM_LDAP_SINGLEMATCH 0x0001
# define SM_LDAP_MATCHONLY 0x0002
+# define SM_LDAP_USE_ALLATTR 0x0004
+
# endif /* _FFR_LDAP_RECURSION */
struct sm_ldap_struct
{
/* needed for ldap_open or ldap_init */
- char *ldap_host;
+ char *ldap_target;
int ldap_port;
+# if _FFR_LDAP_URI
+ bool ldap_uri;
+# endif /* _FFR_LDAP_URI */
+# if _FFR_LDAP_SETVERSION
+ int ldap_version;
+# endif /* _FFR_LDAP_SETVERSION */
pid_t ldap_pid;
/* options set in ld struct before ldap_bind_s */
@@ -67,7 +81,7 @@ struct sm_ldap_struct
char *ldap_attr[LDAPMAP_MAX_ATTR + 1];
# if _FFR_LDAP_RECURSION
int ldap_attr_type[LDAPMAP_MAX_ATTR + 1];
- char *ldap_attr_final[LDAPMAP_MAX_ATTR + 1];
+ char *ldap_attr_needobjclass[LDAPMAP_MAX_ATTR + 1];
# endif /* _FFR_LDAP_RECURSION */
bool ldap_attrsonly;
@@ -85,13 +99,21 @@ struct sm_ldap_struct
typedef struct sm_ldap_struct SM_LDAP_STRUCT;
# if _FFR_LDAP_RECURSION
-struct sm_ldap_recurse_list
+struct sm_ldap_recurse_entry
{
char *lr_search;
int lr_type;
- struct sm_ldap_recurse_list *lr_next;
+ bool lr_done;
};
+struct sm_ldap_recurse_list
+{
+ int lr_size;
+ int lr_cnt;
+ struct sm_ldap_recurse_entry **lr_data;
+};
+
+typedef struct sm_ldap_recurse_entry SM_LDAP_RECURSE_ENTRY;
typedef struct sm_ldap_recurse_list SM_LDAP_RECURSE_LIST;
# endif /* _FFR_LDAP_RECURSION */
@@ -100,13 +122,18 @@ extern void sm_ldap_clear __P((SM_LDAP_STRUCT *));
extern bool sm_ldap_start __P((char *, SM_LDAP_STRUCT *));
extern int sm_ldap_search __P((SM_LDAP_STRUCT *, char *));
# if _FFR_LDAP_RECURSION
-extern int sm_ldap_results __P((SM_LDAP_STRUCT *, int, int, char,
- SM_RPOOL_T *, char **,
+extern int sm_ldap_results __P((SM_LDAP_STRUCT *, int, int, int,
+ SM_RPOOL_T *, char **, int *, int *,
SM_LDAP_RECURSE_LIST *));
# endif /* _FFR_LDAP_RECURSION */
extern void sm_ldap_setopts __P((LDAP *, SM_LDAP_STRUCT *));
extern int sm_ldap_geterrno __P((LDAP *));
extern void sm_ldap_close __P((SM_LDAP_STRUCT *));
-# endif /* LDAPMAP */
+/* Portability defines */
+# if !SM_CONF_LDAP_MEMFREE
+# define ldap_memfree(x) ((void) 0)
+# endif /* !SM_CONF_LDAP_MEMFREE */
+
+# endif /* LDAPMAP */
#endif /* ! SM_LDAP_H */
OpenPOWER on IntegriCloud