annotate lisp/ldap.el @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents aabb7f5b1c81
children a86b2b5e0111
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
1 ;;; ldap.el --- LDAP support for Emacs
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
2
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
4
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
5 ;; Author: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
6 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
7 ;; Created: Jan 1998
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
8 ;; Version: $Revision: 1.7.2.6 $
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
9 ;; Keywords: help comm
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
10
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
12
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
16 ;; any later version.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
17
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
21 ;; General Public License for more details.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
22
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
25 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
26 ;; Boston, MA 02111-1307, USA.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
27
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
28 ;;; Commentary:
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
29 ;; This file provides mid-level and user-level functions to access directory
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
30 ;; servers using the LDAP protocol (RFC 1777).
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
31
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
32 ;;; Installation:
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
33 ;; LDAP support must have been built into XEmacs.
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
34
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
35
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
36 ;;; Code:
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
37
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
38 (defgroup ldap nil
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
39 "Lightweight Directory Access Protocol"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
40 :group 'comm)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
41
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
42 (defcustom ldap-default-host nil
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
43 "*Default LDAP server hostname.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
44 A TCP port number can be appended to that name using a colon as
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
45 a separator."
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
46 :type '(choice (string :tag "Host name")
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
47 (const :tag "Use library default" nil))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
48 :group 'ldap)
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
49
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
50 (defcustom ldap-default-port nil
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
51 "*Default TCP port for LDAP connections.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
52 Initialized from the LDAP library at build time. Default value is 389."
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
53 :type '(choice (const :tag "Use library default" nil)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
54 (integer :tag "Port number"))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
55 :group 'ldap)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
56
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
57 (defcustom ldap-default-base nil
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
58 "*Default base for LDAP searches.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
59 This is a string using the syntax of RFC 1779.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
60 For instance, \"o=ACME, c=US\" limits the search to the
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
61 Acme organization in the United States."
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
62 :type '(choice (const :tag "Use library default" nil)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
63 (string :tag "Search base"))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
64 :group 'ldap)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
65
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
66
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
67 (defcustom ldap-host-parameters-alist nil
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
68 "*Alist of host-specific options for LDAP transactions.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
69 The format of each list element is:
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
70 \(HOST PROP1 VAL1 PROP2 VAL2 ...)
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
71 HOST is the hostname of an LDAP server (with an optional TCP port number
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
72 appended to it using a colon as a separator).
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
73 PROPn and VALn are property/value pairs describing parameters for the server.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
74 Valid properties include:
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
75 `binddn' is the distinguished name of the user to bind as
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
76 (in RFC 1779 syntax).
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
77 `passwd' is the password to use for simple authentication.
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
78 `auth' is the authentication method to use.
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
79 Possible values are: `simple', `krbv41' and `krbv42'.
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
80 `base' is the base for the search as described in RFC 1779.
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
81 `scope' is one of the three symbols `subtree', `base' or `onelevel'.
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
82 `deref' is one of the symbols `never', `always', `search' or `find'.
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
83 `timelimit' is the timeout limit for the connection in seconds.
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
84 `sizelimit' is the maximum number of matches to return."
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
85 :type '(repeat :menu-tag "Host parameters"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
86 :tag "Host parameters"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
87 (list :menu-tag "Host parameters"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
88 :tag "Host parameters"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
89 :value nil
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
90 (string :tag "Host name")
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
91 (checklist :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
92 :greedy t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
93 (list
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
94 :tag "Search Base"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
95 :inline t
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
96 (const :tag "Search Base" base)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
97 string)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
98 (list
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
99 :tag "Binding DN"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
100 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
101 (const :tag "Binding DN" binddn)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
102 string)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
103 (list
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
104 :tag "Password"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
105 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
106 (const :tag "Password" passwd)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
107 string)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
108 (list
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
109 :tag "Authentication Method"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
110 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
111 (const :tag "Authentication Method" auth)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
112 (choice
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
113 (const :menu-tag "None" :tag "None" nil)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
114 (const :menu-tag "Simple" :tag "Simple" simple)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
115 (const :menu-tag "Kerberos 4.1" :tag "Kerberos 4.1" krbv41)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
116 (const :menu-tag "Kerberos 4.2" :tag "Kerberos 4.2" krbv42)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
117 (list
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
118 :tag "Search Scope"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
119 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
120 (const :tag "Search Scope" scope)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
121 (choice
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
122 (const :menu-tag "Default" :tag "Default" nil)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
123 (const :menu-tag "Subtree" :tag "Subtree" subtree)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
124 (const :menu-tag "Base" :tag "Base" base)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
125 (const :menu-tag "One Level" :tag "One Level" onelevel)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
126 (list
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
127 :tag "Dereferencing"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
128 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
129 (const :tag "Dereferencing" deref)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
130 (choice
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
131 (const :menu-tag "Default" :tag "Default" nil)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
132 (const :menu-tag "Never" :tag "Never" never)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
133 (const :menu-tag "Always" :tag "Always" always)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
134 (const :menu-tag "When searching" :tag "When searching" search)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
135 (const :menu-tag "When locating base" :tag "When locating base" find)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
136 (list
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
137 :tag "Time Limit"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
138 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
139 (const :tag "Time Limit" timelimit)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
140 (integer :tag "(in seconds)"))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
141 (list
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
142 :tag "Size Limit"
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
143 :inline t
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
144 (const :tag "Size Limit" sizelimit)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
145 (integer :tag "(number of records)")))))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
146 :group 'ldap)
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 361
diff changeset
147
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
148 (defcustom ldap-ignore-attribute-codings nil
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
149 "*If non-nil, do not perform any encoding/decoding on LDAP attribute values."
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
150 :type 'boolean
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
151 :group 'ldap)
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
152
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
153 (defcustom ldap-default-attribute-decoder nil
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
154 "*Decoder function to use for attributes whose syntax is unknown."
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
155 :type 'symbol
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
156 :group 'ldap)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
157
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
158 (defcustom ldap-coding-system nil
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
159 "*Coding system of LDAP string values.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
160 LDAP v3 specifies the coding system of strings to be UTF-8.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
161 Mule support is needed for this."
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
162 :type 'symbol
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
163 :group 'ldap)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
164
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
165 (defvar ldap-attribute-syntax-encoders
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
166 [nil ; 1 ACI Item N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
167 nil ; 2 Access Point Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
168 nil ; 3 Attribute Type Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
169 nil ; 4 Audio N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
170 nil ; 5 Binary N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
171 nil ; 6 Bit String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
172 ldap-encode-boolean ; 7 Boolean Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
173 nil ; 8 Certificate N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
174 nil ; 9 Certificate List N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
175 nil ; 10 Certificate Pair N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
176 ldap-encode-country-string ; 11 Country String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
177 ldap-encode-string ; 12 DN Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
178 nil ; 13 Data Quality Syntax Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
179 nil ; 14 Delivery Method Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
180 ldap-encode-string ; 15 Directory String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
181 nil ; 16 DIT Content Rule Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
182 nil ; 17 DIT Structure Rule Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
183 nil ; 18 DL Submit Permission Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
184 nil ; 19 DSA Quality Syntax Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
185 nil ; 20 DSE Type Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
186 nil ; 21 Enhanced Guide Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
187 nil ; 22 Facsimile Telephone Number Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
188 nil ; 23 Fax N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
189 nil ; 24 Generalized Time Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
190 nil ; 25 Guide Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
191 nil ; 26 IA5 String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
192 number-to-string ; 27 INTEGER Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
193 nil ; 28 JPEG N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
194 nil ; 29 Master And Shadow Access Points Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
195 nil ; 30 Matching Rule Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
196 nil ; 31 Matching Rule Use Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
197 nil ; 32 Mail Preference Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
198 nil ; 33 MHS OR Address Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
199 nil ; 34 Name And Optional UID Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
200 nil ; 35 Name Form Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
201 nil ; 36 Numeric String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
202 nil ; 37 Object Class Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
203 nil ; 38 OID Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
204 nil ; 39 Other Mailbox Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
205 nil ; 40 Octet String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
206 ldap-encode-address ; 41 Postal Address Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
207 nil ; 42 Protocol Information Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
208 nil ; 43 Presentation Address Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
209 ldap-encode-string ; 44 Printable String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
210 nil ; 45 Subtree Specification Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
211 nil ; 46 Supplier Information Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
212 nil ; 47 Supplier Or Consumer Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
213 nil ; 48 Supplier And Consumer Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
214 nil ; 49 Supported Algorithm N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
215 nil ; 50 Telephone Number Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
216 nil ; 51 Teletex Terminal Identifier Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
217 nil ; 52 Telex Number Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
218 nil ; 53 UTC Time Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
219 nil ; 54 LDAP Syntax Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
220 nil ; 55 Modify Rights Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
221 nil ; 56 LDAP Schema Definition Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
222 nil ; 57 LDAP Schema Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
223 nil ; 58 Substring Assertion Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
224 ]
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
225 "A vector of functions used to encode LDAP attribute values.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
226 The sequence of functions corresponds to the sequence of LDAP attribute syntax
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
227 object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
228 RFC2252 section 4.3.2")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
229
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
230 (defvar ldap-attribute-syntax-decoders
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
231 [nil ; 1 ACI Item N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
232 nil ; 2 Access Point Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
233 nil ; 3 Attribute Type Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
234 nil ; 4 Audio N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
235 nil ; 5 Binary N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
236 nil ; 6 Bit String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
237 ldap-decode-boolean ; 7 Boolean Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
238 nil ; 8 Certificate N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
239 nil ; 9 Certificate List N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
240 nil ; 10 Certificate Pair N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
241 ldap-decode-string ; 11 Country String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
242 ldap-decode-string ; 12 DN Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
243 nil ; 13 Data Quality Syntax Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
244 nil ; 14 Delivery Method Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
245 ldap-decode-string ; 15 Directory String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
246 nil ; 16 DIT Content Rule Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
247 nil ; 17 DIT Structure Rule Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
248 nil ; 18 DL Submit Permission Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
249 nil ; 19 DSA Quality Syntax Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
250 nil ; 20 DSE Type Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
251 nil ; 21 Enhanced Guide Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
252 nil ; 22 Facsimile Telephone Number Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
253 nil ; 23 Fax N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
254 nil ; 24 Generalized Time Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
255 nil ; 25 Guide Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
256 nil ; 26 IA5 String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
257 string-to-number ; 27 INTEGER Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
258 nil ; 28 JPEG N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
259 nil ; 29 Master And Shadow Access Points Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
260 nil ; 30 Matching Rule Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
261 nil ; 31 Matching Rule Use Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
262 nil ; 32 Mail Preference Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
263 nil ; 33 MHS OR Address Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
264 nil ; 34 Name And Optional UID Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
265 nil ; 35 Name Form Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
266 nil ; 36 Numeric String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
267 nil ; 37 Object Class Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
268 nil ; 38 OID Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
269 nil ; 39 Other Mailbox Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
270 nil ; 40 Octet String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
271 ldap-decode-address ; 41 Postal Address Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
272 nil ; 42 Protocol Information Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
273 nil ; 43 Presentation Address Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
274 ldap-decode-string ; 44 Printable String Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
275 nil ; 45 Subtree Specification Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
276 nil ; 46 Supplier Information Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
277 nil ; 47 Supplier Or Consumer Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
278 nil ; 48 Supplier And Consumer Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
279 nil ; 49 Supported Algorithm N
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
280 nil ; 50 Telephone Number Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
281 nil ; 51 Teletex Terminal Identifier Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
282 nil ; 52 Telex Number Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
283 nil ; 53 UTC Time Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
284 nil ; 54 LDAP Syntax Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
285 nil ; 55 Modify Rights Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
286 nil ; 56 LDAP Schema Definition Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
287 nil ; 57 LDAP Schema Description Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
288 nil ; 58 Substring Assertion Y
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
289 ]
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
290 "A vector of functions used to decode LDAP attribute values.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
291 The sequence of functions corresponds to the sequence of LDAP attribute syntax
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
292 object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
293 RFC2252 section 4.3.2")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
294
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
295
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
296 (defvar ldap-attribute-syntaxes-alist
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
297 '((createtimestamp . 24)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
298 (modifytimestamp . 24)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
299 (creatorsname . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
300 (modifiersname . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
301 (subschemasubentry . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
302 (attributetypes . 3)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
303 (objectclasses . 37)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
304 (matchingrules . 30)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
305 (matchingruleuse . 31)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
306 (namingcontexts . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
307 (altserver . 26)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
308 (supportedextension . 38)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
309 (supportedcontrol . 38)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
310 (supportedsaslmechanisms . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
311 (supportedldapversion . 27)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
312 (ldapsyntaxes . 16)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
313 (ditstructurerules . 17)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
314 (nameforms . 35)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
315 (ditcontentrules . 16)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
316 (objectclass . 38)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
317 (aliasedobjectname . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
318 (cn . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
319 (sn . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
320 (serialnumber . 44)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
321 (c . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
322 (l . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
323 (st . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
324 (street . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
325 (o . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
326 (ou . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
327 (title . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
328 (description . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
329 (searchguide . 25)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
330 (businesscategory . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
331 (postaladdress . 41)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
332 (postalcode . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
333 (postofficebox . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
334 (physicaldeliveryofficename . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
335 (telephonenumber . 50)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
336 (telexnumber . 52)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
337 (telexterminalidentifier . 51)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
338 (facsimiletelephonenumber . 22)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
339 (x121address . 36)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
340 (internationalisdnnumber . 36)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
341 (registeredaddress . 41)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
342 (destinationindicator . 44)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
343 (preferreddeliverymethod . 14)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
344 (presentationaddress . 43)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
345 (supportedapplicationcontext . 38)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
346 (member . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
347 (owner . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
348 (roleoccupant . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
349 (seealso . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
350 (userpassword . 40)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
351 (usercertificate . 8)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
352 (cacertificate . 8)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
353 (authorityrevocationlist . 9)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
354 (certificaterevocationlist . 9)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
355 (crosscertificatepair . 10)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
356 (name . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
357 (givenname . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
358 (initials . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
359 (generationqualifier . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
360 (x500uniqueidentifier . 6)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
361 (dnqualifier . 44)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
362 (enhancedsearchguide . 21)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
363 (protocolinformation . 42)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
364 (distinguishedname . 12)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
365 (uniquemember . 34)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
366 (houseidentifier . 15)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
367 (supportedalgorithms . 49)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
368 (deltarevocationlist . 9)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
369 (dmdname . 15))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
370 "A map of LDAP attribute names to their type object id minor number.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
371 This table is built from RFC2252 Section 5 and RFC2256 Section 5")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
372
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
373
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
374 ;; Coding/decoding functions
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
375
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
376 (defun ldap-encode-boolean (bool)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
377 (if bool
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
378 "TRUE"
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
379 "FALSE"))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
380
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
381 (defun ldap-decode-boolean (str)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
382 (cond
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
383 ((string-equal str "TRUE")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
384 t)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
385 ((string-equal str "FALSE")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
386 nil)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
387 (t
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
388 (error "Wrong LDAP boolean string: %s" str))))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
389
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
390 (defun ldap-encode-country-string (str)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
391 ;; We should do something useful here...
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
392 (if (not (= 2 (length str)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
393 (error "Invalid country string: %s" str)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
394
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
395 (defun ldap-decode-string (str)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
396 (if (fboundp 'decode-coding-string)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
397 (decode-coding-string str ldap-coding-system)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
399 (defun ldap-encode-string (str)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
400 (if (fboundp 'encode-coding-string)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
401 (encode-coding-string str ldap-coding-system)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
402
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
403 (defun ldap-decode-address (str)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
404 (mapconcat 'ldap-decode-string
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
405 (split-string str "\\$")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
406 "\n"))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
407
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
408 (defun ldap-encode-address (str)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
409 (mapconcat 'ldap-encode-string
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
410 (split-string str "\n")
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
411 "$"))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
412
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
413
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
414 ;; LDAP protocol functions
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
415
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
416 (defun ldap-get-host-parameter (host parameter)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
417 "Get the value of PARAMETER for HOST in `ldap-host-parameters-alist'."
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
418 (plist-get (cdr (assoc host ldap-host-parameters-alist))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
419 parameter))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
420
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
421 (defun ldap-decode-attribute (attr)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
422 "Decode the attribute/value pair ATTR according to LDAP rules.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
423 The attribute name is looked up in `ldap-attribute-syntaxes-alist'
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
424 and the corresponding decoder is then retrieved from
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
425 `ldap-attribute-syntax-decoders' and applied on the value(s)."
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
426 (let* ((name (car attr))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
427 (values (cdr attr))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
428 (syntax-id (cdr (assq (intern (downcase name))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
429 ldap-attribute-syntaxes-alist)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
430 decoder)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
431 (if syntax-id
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
432 (setq decoder (aref ldap-attribute-syntax-decoders
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
433 (1- syntax-id)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
434 (setq decoder ldap-default-attribute-decoder))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
435 (if decoder
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
436 (cons name (mapcar decoder values))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
437 attr)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
438
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
439
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
440 (defun ldap-search (filter &optional host attributes attrsonly withdn)
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
441 "Perform an LDAP search.
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
442 FILTER is the search filter in RFC1558 syntax, i.e., something that
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
443 looks like \"(cn=John Smith)\".
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
444 HOST is the LDAP host on which to perform the search.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
445 ATTRIBUTES is a list of attributes to retrieve; nil means retrieve all.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
446 If ATTRSONLY is non nil, the attributes will be retrieved without
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
447 the associated values.
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
448 If WITHDN is non-nil each entry in the result will be prepennded with
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
449 its distinguished name DN.
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
450 Additional search parameters can be specified through
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
451 `ldap-host-parameters-alist' which see.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
452 The function returns a list of matching entries. Each entry is itself
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
453 an alist of attribute/value pairs optionally preceded by the DN of the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
454 entry according to the value of WITHDN."
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
455 (interactive "sFilter:")
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
456 (or host
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
457 (setq host ldap-default-host)
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
458 (error "No LDAP host specified"))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 371
diff changeset
459 (let ((host-plist (cdr (assoc host ldap-host-parameters-alist)))
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
460 ldap
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
461 result)
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 261
diff changeset
462 (message "Opening LDAP connection to %s..." host)
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
463 (setq ldap (ldap-open host host-plist))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 261
diff changeset
464 (message "Searching with LDAP on %s..." host)
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
465 (setq result (ldap-search-internal ldap filter
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
466 (plist-get host-plist 'base)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
467 (plist-get host-plist 'scope)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
468 attributes attrsonly withdn))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
469 (ldap-close ldap)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
470 (if ldap-ignore-attribute-codings
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
471 result
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
472 (mapcar (function
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
473 (lambda (record)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
474 (mapcar 'ldap-decode-attribute record)))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 388
diff changeset
475 result))))
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
476
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
477 (provide 'ldap)
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 361
diff changeset
478
259
11cf20601dec Import from CVS: tag r20-5b28
cvs
parents:
diff changeset
479 ;;; ldap.el ends here