annotate man/lispref/ldap.texi @ 4792:95b04754ea8c

Make #'equalp more compatible with CL; add a compiler macro, test & doc it. lisp/ChangeLog addition: 2009-11-08 Aidan Kehoe <kehoea@parhasard.net> * cl-extra.el (cl-string-vector-equalp) (cl-bit-vector-vector-equalp, cl-vector-array-equalp) (cl-hash-table-contents-equalp): New functions, to implement equalp treating arrays with identical contents as equivalent, as specified by Common Lisp. (equalp): Revise this function to implement array equivalence, and the hash-table equalp behaviour specified by CL. * cl-macs.el (equalp): Add a compiler macro for this function, used when one of the arguments is constant, and as such, its type is known at compile time. man/ChangeLog addition: 2009-11-08 Aidan Kehoe <kehoea@parhasard.net> * lispref/objects.texi (Equality Predicates): Document #'equalp here, as well as #'equal and #'eq. tests/ChangeLog addition: 2009-12-31 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Test much of the functionality of equalp; add a pointer to Paul Dietz' ANSI test suite for this function, converted to Emacs Lisp. Not including the tests themselves in XEmacs because who owns the copyright on the files is unclear and the GCL people didn't respond to my queries.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 31 Dec 2009 15:09:41 +0000
parents 8d2106500793
children 9fae6227ede5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
3 @c Copyright (C) 1998 Free Software Foundation, Inc.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 @setfilename ../../info/ldap.info
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
6 @node LDAP Support, PostgreSQL Support, ToolTalk Support, top
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 @chapter LDAP Support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 @cindex LDAP
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 XEmacs can be linked with a LDAP client library to provide Elisp primitives
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 to access directory servers using the Lightweight Directory Access Protocol.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 * Building XEmacs with LDAP support:: How to add LDAP support to XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 * XEmacs LDAP API:: Lisp access to LDAP functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 * Syntax of Search Filters:: A brief summary of RFC 1558
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 @node Building XEmacs with LDAP support, XEmacs LDAP API, LDAP Support, LDAP Support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 @section Building XEmacs with LDAP support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 LDAP support must be added to XEmacs at build time since it requires
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 linking to an external LDAP client library. As of 21.2, XEmacs has been
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 successfully built and tested with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 @itemize @bullet
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
28 @item OpenLDAP 1.2 (@url{http://www.openldap.org/})
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 @item University of Michigan's LDAP 3.3 (@url{http://www.umich.edu/~dirsvcs/ldap/})
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 @item LDAP SDK 1.0 from Netscape Corp. (@url{http://developer.netscape.com/})
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 Other libraries conforming to RFC 1823 will probably work also but may
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 require some minor tweaking at C level.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
36 The standard XEmacs configure script auto-detects an installed LDAP
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 library provided the library itself and the corresponding header files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 can be found in the library and include paths. A successful detection
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 will be signalled in the final output of the configure script.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 @node XEmacs LDAP API, Syntax of Search Filters, Building XEmacs with LDAP support, LDAP Support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 @section XEmacs LDAP API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 XEmacs LDAP API consists of two layers: a low-level layer which tries
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 to stay as close as possible to the C API (where practical) and a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 higher-level layer which provides more convenient primitives to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 effectively use LDAP.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
52 The low-level API should be used directly for very specific purposes
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
53 (such as multiple operations on a connection) only. The higher-level
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
54 functions provide a more convenient way to access LDAP directories
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
55 hiding the subtleties of handling the connection, translating arguments
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
56 and ensuring compliance with LDAP internationalization rules and formats
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
57 (currently partly implemented only).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 * LDAP Variables:: Lisp variables related to LDAP
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
61 * The High-Level LDAP API:: High-level LDAP lisp functions
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 * The Low-Level LDAP API:: Low-level LDAP lisp primitives
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
63 * LDAP Internationalization:: I18n variables and functions
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 @node LDAP Variables, The High-Level LDAP API, XEmacs LDAP API, XEmacs LDAP API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 @subsection LDAP Variables
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 @defvar ldap-default-host
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 The default LDAP server hostname.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
73 A TCP port number can be appended to that name using a colon as
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 a separator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 @defvar ldap-default-port
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 Default TCP port for LDAP connections.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 Initialized from the LDAP library. Default value is 389.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 @defvar ldap-default-base
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 Default base for LDAP searches.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 This is a string using the syntax of RFC 1779.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
85 For instance, "o=ACME, c=US" limits the search to the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 Acme organization in the United States.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 @defvar ldap-host-parameters-alist
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
90 An alist of per host options for LDAP transactions.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 The list elements look like @code{(HOST PROP1 VAL1 PROP2 VAL2 ...)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 @var{host} is the name of an LDAP server. A TCP port number can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 appended to that name using a colon as a separator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 @var{propn} and @var{valn} are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 property/value pairs describing parameters for the server. Valid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 properties:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 @item binddn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 The distinguished name of the user to bind as. This may look like
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
100 @samp{cn=Babs Jensen,o=ACME,c=US}, see RFC 1779 for details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 @item passwd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 The password to use for authentication.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 @item auth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 The authentication method to use, possible values depend on the LDAP
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 library XEmacs was compiled with, they may include @code{simple},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 @code{krbv41} and @code{krbv42}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 @item base
3979
8d2106500793 [xemacs-hg @ 2007-05-21 11:39:55 by scop]
scop
parents: 1738
diff changeset
108 The base for the search. This may look like @samp{o=ACME, c=US}, see
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 RFC 1779 for syntax details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 @item scope
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
111 One of the symbols @code{base}, @code{onelevel} or @code{subtree}
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 indicating the scope of the search limited to a base
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
113 object, to a single level or to the whole subtree.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 @item deref
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 The dereference policy is one of the symbols @code{never},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 @code{always}, @code{search} or @code{find} and defines how aliases are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 dereferenced.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 @item never
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 Aliases are never dereferenced
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 @item always
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 Aliases are always dereferenced
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 @item search
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 Aliases are dereferenced when searching
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 @item find
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 Aliases are dereferenced when locating the base object for the search
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 @item timelimit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 The timeout limit for the connection in seconds.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 @item sizelimit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 The maximum number of matches to return for searches performed on this connection.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
135 @defvar ldap-verbose
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
136 If non-@code{nil}, LDAP operations will echo progress messages. Defaults to @code{nil}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
137 @end defvar
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 @node The High-Level LDAP API, The Low-Level LDAP API, LDAP Variables, XEmacs LDAP API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 @subsection The High-Level LDAP API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
144 The following functions provide the most convenient interface to perform
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
145 LDAP operations. All of them open a connection to a host, perform an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
146 operation (add/search/modify/delete) on one or several entries and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
147 cleanly close the connection thus insulating the user from all the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
148 details of the low-level interface such as LDAP Lisp objects @pxref{The
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
149 Low-Level LDAP API}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
151 Note that @code{ldap-search} which used to be the name of the high-level
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
152 search function in XEmacs 21.1 is now obsolete. For consistency in the
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
153 naming as well as backward compatibility, that function now acts as a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
154 wrapper that calls either @code{ldap-search-basic} (low-level search
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
155 function) or @code{ldap-search-entries} (high-level search function)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
156 according to the actual parameters. A direct call to one of these two
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
157 functions is preferred since it is faster and unambiguous.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
159 @deffn Command ldap-search-entries filter &optional host attributes attrsonly withdn
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 Perform an LDAP search.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 @var{filter} is the search filter @pxref{Syntax of Search Filters}
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
162 @var{host} is the LDAP host on which to perform the search.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
163 @var{attributes} is the specific attributes to retrieve, @code{nil} means
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
164 retrieve all.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
165 @var{attrsonly} if non-@code{nil} retrieves the attributes only without
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 their associated values.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
167 If @var{withdn} is non-@code{nil} each entry in the result will be prepended with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
168 its distinguished name DN.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
169 Additional search parameters can be specified through
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 @code{ldap-host-parameters-alist}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
171 The function returns a list of matching entries. Each entry is itself
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
172 an alist of attribute/value pairs optionally preceded by the DN of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
173 entry according to the value of @var{withdn}.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
174 @end deffn
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
175
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
176 @defun ldap-add-entries entries &optional host binddn passwd
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
177 Add entries to an LDAP directory. @var{entries} is a list of entry
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
178 specifications of the form @code{(DN (ATTR . VALUE) (ATTR . VALUE) ...)}
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
179 where @var{dn} the distinguished name of an entry to add, the following
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
180 are cons cells containing attribute/value string pairs.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
181 @var{host} is the LDAP host, defaulting to @code{ldap-default-host}.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
182 @var{binddn} is the DN to bind as to the server.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
183 @var{passwd} is the corresponding password.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
186 @defun ldap-modify-entries entry-mods &optional host binddn passwd
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
187 Modify entries of an LDAP directory.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
188 @var{entry_mods} is a list of entry modifications of the form
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
189 @code{(DN MOD-SPEC1 MOD-SPEC2 ...)} where @var{dn} is the distinguished name of
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
190 the entry to modify, the following are modification specifications.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
191 A modification specification is itself a list of the form
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
192 @code{(MOD-OP ATTR VALUE1 VALUE2 ...)} @var{mod-op} and @var{attr} are mandatory,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
193 @var{values} are optional depending on @var{mod-op}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
194 @var{mod-op} is the type of modification, one of the symbols @code{add}, @code{delete}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
195 or @code{replace}. @var{attr} is the LDAP attribute type to modify.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
196 @var{host} is the LDAP host, defaulting to @code{ldap-default-host}.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
197 @var{binddn} is the DN to bind as to the server.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
198 @var{passwd} is the corresponding password.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
199 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
200
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
201 @defun ldap-delete-entries dn &optional host binddn passwd
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
202 Delete an entry from an LDAP directory.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
203 @var{dn} is the distinguished name of an entry to delete or
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
204 a list of those.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
205 @var{host} is the LDAP host, defaulting to @code{ldap-default-host}.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
206 @var{binddn} is the DN to bind as to the server.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
207 @var{passwd} is the corresponding password.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
208 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
209
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
210
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
211 @node The Low-Level LDAP API, LDAP Internationalization, The High-Level LDAP API, XEmacs LDAP API
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 @subsection The Low-Level LDAP API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
215 The low-level API should be used directly for very specific purposes
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
216 (such as multiple operations on a connection) only. The higher-level
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
217 functions provide a more convenient way to access LDAP directories
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
218 hiding the subtleties of handling the connection, translating arguments
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
219 and ensuring compliance with LDAP internationalization rules and formats
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
220 (currently partly implemented only). See @pxref{The High-Level LDAP API}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
221
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
222 Note that the former functions @code{ldap-*-internal} functions have been
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
223 renamed in XEmacs 21.2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
224
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 @menu
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
226 * The LDAP Lisp Object::
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
227 * Opening and Closing a LDAP Connection::
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
228 * Low-level Operations on a LDAP Server::
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 @node The LDAP Lisp Object, Opening and Closing a LDAP Connection, The Low-Level LDAP API, The Low-Level LDAP API
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 @subsubsection The LDAP Lisp Object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 An internal built-in @code{ldap} lisp object represents a LDAP
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 connection.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 @defun ldapp object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 This function returns non-@code{nil} if @var{object} is a @code{ldap} object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 @defun ldap-host ldap
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
243 Return the server host of the connection represented by @var{ldap}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 @defun ldap-live-p ldap
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
247 Return non-@code{nil} if @var{ldap} is an active LDAP connection.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
251 @node Opening and Closing a LDAP Connection, Low-level Operations on a LDAP Server, The LDAP Lisp Object, The Low-Level LDAP API
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 @subsubsection Opening and Closing a LDAP Connection
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 @defun ldap-open host &optional plist
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 Open a LDAP connection to @var{host}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 @var{plist} is a property list containing additional parameters for the connection.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 Valid keys in that list are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 @item port
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 The TCP port to use for the connection if different from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 @code{ldap-default-port} or the library builtin value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 @item auth
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 The authentication method to use, possible values depend on the LDAP
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 library XEmacs was compiled with, they may include @code{simple},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 @code{krbv41} and @code{krbv42}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 @item binddn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 The distinguished name of the user to bind as. This may look like
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
269 @samp{c=com, o=Acme, cn=Babs Jensen}, see RFC 1779 for details.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 @item passwd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 The password to use for authentication.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 @item deref
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 The dereference policy is one of the symbols @code{never},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 @code{always}, @code{search} or @code{find} and defines how aliases are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 dereferenced.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 @item never
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
278 Aliases are never dereferenced.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 @item always
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
280 Aliases are always dereferenced.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 @item search
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
282 Aliases are dereferenced when searching.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 @item find
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
284 Aliases are dereferenced when locating the base object for the search.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 The default is @code{never}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 @item timelimit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 The timeout limit for the connection in seconds.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 @item sizelimit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 The maximum number of matches to return for searches performed on this connection.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 @defun ldap-close ldap
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
295 Close the connection represented by @var{ldap}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
299 @node Low-level Operations on a LDAP Server, , Opening and Closing a LDAP Connection, The Low-Level LDAP API
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 @comment node-name, next, previous, up
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
301 @subsubsection Low-level Operations on a LDAP Server
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
303 @code{ldap-search-basic} is the low-level primitive to perform a
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 search on a LDAP server. It works directly on an open LDAP connection
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 thus requiring a preliminary call to @code{ldap-open}. Multiple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 searches can be made on the same connection, then the session must be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 closed with @code{ldap-close}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
309 @defun ldap-search-basic ldap filter &optional base scope attrs attrsonly withdn verbose
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 Perform a search on an open connection @var{ldap} created with @code{ldap-open}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 @var{filter} is a filter string for the search @pxref{Syntax of Search Filters}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 @var{base} is the distinguished name at which to start the search.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 @var{scope} is one of the symbols @code{base}, @code{onelevel} or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 @code{subtree} indicating the scope of the search limited to a base
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 object, to a single level or to the whole subtree. The default is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 @code{subtree}.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
317 @var{attrs} is a list of strings indicating which attributes to retrieve
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 for each matching entry. If @code{nil} all available attributes are returned.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
319 If @var{attrsonly} is non-@code{nil} then only the attributes are
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
320 retrieved, not their associated values.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
321 If @var{withdn} is non-@code{nil} then each entry in the result is
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
322 prepended with its distinguished name DN.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
323 If @var{verbose} is non-@code{nil} then progress messages are echoed
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
324 The function returns a list of matching entries. Each entry is itself
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
325 an alist of attribute/value pairs optionally preceded by the DN of the
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
326 entry according to the value of @var{withdn}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
327 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
328
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
329 @defun ldap-add ldap dn entry
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
330 Add @var{entry} to a LDAP directory which a connection @var{ldap} has
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
331 been opened to with @code{ldap-open}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
332 @var{dn} is the distinguished name of the entry to add.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
333 @var{entry} is an entry specification, i.e., a list of cons cells
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
334 containing attribute/value string pairs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
335 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
336
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
337 @defun ldap-modify ldap dn mods
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
338 Modify an entry in an LDAP directory.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
339 @var{ldap} is an LDAP connection object created with @code{ldap-open}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
340 @var{dn} is the distinguished name of the entry to modify.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
341 @var{mods} is a list of modifications to apply.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
342 A modification is a list of the form @code{(MOD-OP ATTR VALUE1 VALUE2 ...)}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
343 @var{mod-op} and @var{attr} are mandatory, @var{values} are optional depending on @var{mod-op}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
344 @var{mod-op} is the type of modification, one of the symbols @code{add}, @code{delete}
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
345 or @code{replace}. @var{attr} is the LDAP attribute type to modify.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
346 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
347
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
348 @defun ldap-delete ldap dn
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
349 Delete an entry to an LDAP directory.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
350 @var{ldap} is an LDAP connection object created with @code{ldap-open}.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
351 @var{dn} is the distinguished name of the entry to delete.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
356 @node LDAP Internationalization, , The Low-Level LDAP API, XEmacs LDAP API
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
357 @comment node-name, next, previous, up
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
358 @subsection LDAP Internationalization
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
359
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
360 The XEmacs LDAP API provides basic internationalization features based
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
361 on the LDAP v3 specification (essentially RFC2252 on "LDAP v3 Attribute
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
362 Syntax Definitions"). Unfortunately since there is currently no free
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
363 LDAP v3 server software, this part has not received much testing and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
364 should be considered experimental. The framework is in place though.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
365
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
366 @defun ldap-decode-attribute attr
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
367 Decode the attribute/value pair @var{attr} according to LDAP rules.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
368 The attribute name is looked up in @code{ldap-attribute-syntaxes-alist}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
369 and the corresponding decoder is then retrieved from
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
370 @code{ldap-attribute-syntax-decoders}' and applied on the value(s).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
371 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
372
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
373 @menu
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
374 * LDAP Internationalization Variables::
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
375 * Encoder/Decoder Functions::
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
376 @end menu
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
377
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
378 @node LDAP Internationalization Variables, Encoder/Decoder Functions, LDAP Internationalization, LDAP Internationalization
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
379 @comment node-name, next, previous, up
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
380 @subsubsection LDAP Internationalization Variables
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
381
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
382 @defvar ldap-ignore-attribute-codings
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
383 If non-@code{nil}, no encoding/decoding will be performed LDAP attribute values
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
384 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
385
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
386 @defvar ldap-coding-system
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
387 Coding system of LDAP string values.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
388 LDAP v3 specifies the coding system of strings to be UTF-8.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
389 You need an XEmacs with Mule support for this.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
390 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
391
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
392 @defvar ldap-default-attribute-decoder
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
393 Decoder function to use for attributes whose syntax is unknown. Such a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
394 function receives an encoded attribute value as a string and should
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
395 return the decoded value as a string.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
396 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
397
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
398 @defvar ldap-attribute-syntax-encoders
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
399 A vector of functions used to encode LDAP attribute values.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
400 The sequence of functions corresponds to the sequence of LDAP attribute syntax
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
401 object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
402 RFC2252 section 4.3.2. As of this writing, only a few encoder functions
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
403 are available.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
404 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
405
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
406 @defvar ldap-attribute-syntax-decoders
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
407 A vector of functions used to decode LDAP attribute values.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
408 The sequence of functions corresponds to the sequence of LDAP attribute syntax
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
409 object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
410 RFC2252 section 4.3.2. As of this writing, only a few decoder functions
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
411 are available.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
412 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
413
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
414 @defvar ldap-attribute-syntaxes-alist
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
415 A map of LDAP attribute names to their type object id minor number.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
416 This table is built from RFC2252 Section 5 and RFC2256 Section 5.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
417 @end defvar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
418
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
419 @node Encoder/Decoder Functions, , LDAP Internationalization Variables, LDAP Internationalization
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
420 @comment node-name, next, previous, up
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
421 @subsubsection Encoder/Decoder Functions
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
422
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
423 @defun ldap-encode-boolean bool
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
424 A function that encodes an elisp boolean @var{bool} into a LDAP
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
425 boolean string representation.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
426 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
427
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
428 @defun ldap-decode-boolean str
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
429 A function that decodes a LDAP boolean string representation
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
430 @var{str} into an elisp boolean.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
431 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
432
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
433 @defun ldap-decode-string str
1738
f43f9ca6c7d9 [xemacs-hg @ 2003-10-10 12:39:27 by stephent]
stephent
parents: 444
diff changeset
434 Decode a string @var{str} according to @code{ldap-coding-system}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
435 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
436
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
437 @defun ldap-encode-string str
1738
f43f9ca6c7d9 [xemacs-hg @ 2003-10-10 12:39:27 by stephent]
stephent
parents: 444
diff changeset
438 Encode a string @var{str} according to @code{ldap-coding-system}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
439 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
440
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
441 @defun ldap-decode-address str
1738
f43f9ca6c7d9 [xemacs-hg @ 2003-10-10 12:39:27 by stephent]
stephent
parents: 444
diff changeset
442 Decode an address @var{str} according to @code{ldap-coding-system} and
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
443 replacing $ signs with newlines as specified by LDAP encoding rules for
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
444 addresses.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
445 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
446
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
447 @defun ldap-encode-address str
1738
f43f9ca6c7d9 [xemacs-hg @ 2003-10-10 12:39:27 by stephent]
stephent
parents: 444
diff changeset
448 Encode an address @var{str} according to @code{ldap-coding-system} and
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
449 replacing newlines with $ signs as specified by LDAP encoding rules for
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
450 addresses.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
451 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
452
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 @node Syntax of Search Filters, , XEmacs LDAP API, LDAP Support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 @section Syntax of Search Filters
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 LDAP search functions use RFC1558 syntax to describe the search filter.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 In that syntax simple filters have the form:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 (<attr> <filtertype> <value>)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 @code{<attr>} is an attribute name such as @code{cn} for Common Name,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 @code{o} for Organization, etc...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 @code{<value>} is the corresponding value. This is generally an exact
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 string but may also contain @code{*} characters as wildcards
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
472 @code{filtertype} is one @code{=} @code{~=}, @code{<=}, @code{>=} which
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 respectively describe equality, approximate equality, inferiority and
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
474 superiority.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 Thus @code{(cn=John Smith)} matches all records having a canonical name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 equal to John Smith.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 A special case is the presence filter @code{(<attr>=*} which matches
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 records containing a particular attribute. For instance @code{(mail=*)}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 matches all records containing a @code{mail} attribute.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 Simple filters can be connected together with the logical operators
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 @code{&}, @code{|} and @code{!} which stand for the usual and, or and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 not operators.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 @code{(&(objectClass=Person)(mail=*)(|(sn=Smith)(givenname=John)))}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 matches records of class @code{Person} containing a @code{mail}
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
489 attribute and corresponding to people whose last name is @code{Smith} or
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 whose first name is @code{John}.