annotate lisp/ldap.el @ 414:da8ed4261e83 r21-2-15

Import from CVS: tag r21-2-15
author cvs
date Mon, 13 Aug 2007 11:21:38 +0200
parents 697ef44129c6
children 11054d720c21
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
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
8 ;; Version: $Revision: 1.7.2.5 $
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
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
148 (defcustom ldap-ignore-attribute-codings nil
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
149 "*If non-nil, do not perform any encoding/decoding on LDAP attribute values."
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
150 :type 'boolean
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
151 :group 'ldap)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
152
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
153 (defcustom ldap-default-attribute-decoder nil
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
154 "*Decoder function to use for attributes whose syntax is unknown."
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
155 :type 'symbol
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
156 :group 'ldap)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
157
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
158 (defcustom ldap-coding-system (if (featurep 'mule)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
159 'utf-8
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
160 nil)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
161 "*Coding system of LDAP string values.
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
162 LDAP v3 specifies the coding system of strings to be UTF-8.
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
163 Mule support is needed for this."
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
164 :type 'symbol
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
165 :group 'ldap)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
166
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
167 (defvar ldap-attribute-syntax-encoders
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
168 [nil ; 1 ACI Item N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
169 nil ; 2 Access Point Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
170 nil ; 3 Attribute Type Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
171 nil ; 4 Audio N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
172 nil ; 5 Binary N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
173 nil ; 6 Bit String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
174 ldap-encode-boolean ; 7 Boolean Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
175 nil ; 8 Certificate N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
176 nil ; 9 Certificate List N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
177 nil ; 10 Certificate Pair N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
178 ldap-encode-country-string ; 11 Country String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
179 ldap-encode-string ; 12 DN Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
180 nil ; 13 Data Quality Syntax Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
181 nil ; 14 Delivery Method Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
182 ldap-encode-string ; 15 Directory String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
183 nil ; 16 DIT Content Rule Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
184 nil ; 17 DIT Structure Rule Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
185 nil ; 18 DL Submit Permission Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
186 nil ; 19 DSA Quality Syntax Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
187 nil ; 20 DSE Type Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
188 nil ; 21 Enhanced Guide Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
189 nil ; 22 Facsimile Telephone Number Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
190 nil ; 23 Fax N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
191 nil ; 24 Generalized Time Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
192 nil ; 25 Guide Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
193 nil ; 26 IA5 String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
194 number-to-string ; 27 INTEGER Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
195 nil ; 28 JPEG N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
196 nil ; 29 Master And Shadow Access Points Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
197 nil ; 30 Matching Rule Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
198 nil ; 31 Matching Rule Use Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
199 nil ; 32 Mail Preference Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
200 nil ; 33 MHS OR Address Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
201 nil ; 34 Name And Optional UID Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
202 nil ; 35 Name Form Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
203 nil ; 36 Numeric String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
204 nil ; 37 Object Class Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
205 nil ; 38 OID Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
206 nil ; 39 Other Mailbox Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
207 nil ; 40 Octet String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
208 ldap-encode-address ; 41 Postal Address Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
209 nil ; 42 Protocol Information Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
210 nil ; 43 Presentation Address Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
211 ldap-encode-string ; 44 Printable String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
212 nil ; 45 Subtree Specification Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
213 nil ; 46 Supplier Information Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
214 nil ; 47 Supplier Or Consumer Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
215 nil ; 48 Supplier And Consumer Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
216 nil ; 49 Supported Algorithm N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
217 nil ; 50 Telephone Number Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
218 nil ; 51 Teletex Terminal Identifier Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
219 nil ; 52 Telex Number Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
220 nil ; 53 UTC Time Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
221 nil ; 54 LDAP Syntax Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
222 nil ; 55 Modify Rights Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
223 nil ; 56 LDAP Schema Definition Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
224 nil ; 57 LDAP Schema Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
225 nil ; 58 Substring Assertion Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
226 ]
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
227 "A vector of functions used to encode LDAP attribute values.
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
228 The sequence of functions corresponds to the sequence of LDAP attribute syntax
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
229 object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
230 RFC2252 section 4.3.2")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
231
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
232 (defvar ldap-attribute-syntax-decoders
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
233 [nil ; 1 ACI Item N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
234 nil ; 2 Access Point Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
235 nil ; 3 Attribute Type Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
236 nil ; 4 Audio N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
237 nil ; 5 Binary N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
238 nil ; 6 Bit String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
239 ldap-decode-boolean ; 7 Boolean Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
240 nil ; 8 Certificate N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
241 nil ; 9 Certificate List N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
242 nil ; 10 Certificate Pair N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
243 ldap-decode-string ; 11 Country String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
244 ldap-decode-string ; 12 DN Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
245 nil ; 13 Data Quality Syntax Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
246 nil ; 14 Delivery Method Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
247 ldap-decode-string ; 15 Directory String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
248 nil ; 16 DIT Content Rule Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
249 nil ; 17 DIT Structure Rule Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
250 nil ; 18 DL Submit Permission Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
251 nil ; 19 DSA Quality Syntax Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
252 nil ; 20 DSE Type Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
253 nil ; 21 Enhanced Guide Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
254 nil ; 22 Facsimile Telephone Number Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
255 nil ; 23 Fax N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
256 nil ; 24 Generalized Time Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
257 nil ; 25 Guide Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
258 nil ; 26 IA5 String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
259 string-to-number ; 27 INTEGER Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
260 nil ; 28 JPEG N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
261 nil ; 29 Master And Shadow Access Points Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
262 nil ; 30 Matching Rule Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
263 nil ; 31 Matching Rule Use Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
264 nil ; 32 Mail Preference Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
265 nil ; 33 MHS OR Address Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
266 nil ; 34 Name And Optional UID Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
267 nil ; 35 Name Form Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
268 nil ; 36 Numeric String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
269 nil ; 37 Object Class Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
270 nil ; 38 OID Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
271 nil ; 39 Other Mailbox Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
272 nil ; 40 Octet String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
273 ldap-decode-address ; 41 Postal Address Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
274 nil ; 42 Protocol Information Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
275 nil ; 43 Presentation Address Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
276 ldap-decode-string ; 44 Printable String Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
277 nil ; 45 Subtree Specification Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
278 nil ; 46 Supplier Information Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
279 nil ; 47 Supplier Or Consumer Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
280 nil ; 48 Supplier And Consumer Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
281 nil ; 49 Supported Algorithm N
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
282 nil ; 50 Telephone Number Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
283 nil ; 51 Teletex Terminal Identifier Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
284 nil ; 52 Telex Number Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
285 nil ; 53 UTC Time Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
286 nil ; 54 LDAP Syntax Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
287 nil ; 55 Modify Rights Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
288 nil ; 56 LDAP Schema Definition Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
289 nil ; 57 LDAP Schema Description Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
290 nil ; 58 Substring Assertion Y
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
291 ]
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
292 "A vector of functions used to decode LDAP attribute values.
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
293 The sequence of functions corresponds to the sequence of LDAP attribute syntax
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
294 object identifiers of the form 1.3.6.1.4.1.1466.1115.121.1.* as defined in
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
295 RFC2252 section 4.3.2")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
296
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
297
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
298 (defvar ldap-attribute-syntaxes-alist
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
299 '((createtimestamp . 24)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
300 (modifytimestamp . 24)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
301 (creatorsname . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
302 (modifiersname . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
303 (subschemasubentry . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
304 (attributetypes . 3)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
305 (objectclasses . 37)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
306 (matchingrules . 30)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
307 (matchingruleuse . 31)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
308 (namingcontexts . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
309 (altserver . 26)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
310 (supportedextension . 38)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
311 (supportedcontrol . 38)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
312 (supportedsaslmechanisms . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
313 (supportedldapversion . 27)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
314 (ldapsyntaxes . 16)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
315 (ditstructurerules . 17)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
316 (nameforms . 35)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
317 (ditcontentrules . 16)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
318 (objectclass . 38)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
319 (aliasedobjectname . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
320 (cn . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
321 (sn . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
322 (serialnumber . 44)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
323 (c . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
324 (l . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
325 (st . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
326 (street . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
327 (o . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
328 (ou . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
329 (title . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
330 (description . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
331 (searchguide . 25)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
332 (businesscategory . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
333 (postaladdress . 41)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
334 (postalcode . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
335 (postofficebox . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
336 (physicaldeliveryofficename . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
337 (telephonenumber . 50)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
338 (telexnumber . 52)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
339 (telexterminalidentifier . 51)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
340 (facsimiletelephonenumber . 22)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
341 (x121address . 36)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
342 (internationalisdnnumber . 36)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
343 (registeredaddress . 41)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
344 (destinationindicator . 44)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
345 (preferreddeliverymethod . 14)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
346 (presentationaddress . 43)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
347 (supportedapplicationcontext . 38)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
348 (member . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
349 (owner . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
350 (roleoccupant . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
351 (seealso . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
352 (userpassword . 40)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
353 (usercertificate . 8)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
354 (cacertificate . 8)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
355 (authorityrevocationlist . 9)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
356 (certificaterevocationlist . 9)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
357 (crosscertificatepair . 10)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
358 (name . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
359 (givenname . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
360 (initials . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
361 (generationqualifier . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
362 (x500uniqueidentifier . 6)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
363 (dnqualifier . 44)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
364 (enhancedsearchguide . 21)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
365 (protocolinformation . 42)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
366 (distinguishedname . 12)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
367 (uniquemember . 34)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
368 (houseidentifier . 15)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
369 (supportedalgorithms . 49)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
370 (deltarevocationlist . 9)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
371 (dmdname . 15))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
372 "A map of LDAP attribute names to their type object id minor number.
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
373 This table is built from RFC2252 Section 5 and RFC2256 Section 5")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
374
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
375
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
376 ;; Coding/decoding functions
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
377
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
378 (defun ldap-encode-boolean (bool)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
379 (if bool
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
380 "TRUE"
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
381 "FALSE"))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
382
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
383 (defun ldap-decode-boolean (str)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
384 (cond
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
385 ((string-equal str "TRUE")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
386 t)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
387 ((string-equal str "FALSE")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
388 nil)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
389 (t
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
390 (error "Wrong LDAP boolean string: %s" str))))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
391
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
392 (defun ldap-encode-country-string (str)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
393 ;; We should do something useful here...
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
394 (if (not (= 2 (length str)))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
395 (error "Invalid country string: %s" str)))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
396
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
397 (defun ldap-decode-string (str)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
398 (decode-coding-string str ldap-coding-system))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
399
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
400 (defun ldap-encode-string (str)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
401 (encode-coding-string str ldap-coding-system))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
402
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
403 (defun ldap-decode-address (str)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
404 (mapconcat 'ldap-decode-string
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
405 (split-string str "\\$")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
406 "\n"))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
407
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
408 (defun ldap-encode-address (str)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
409 (mapconcat 'ldap-encode-string
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
410 (split-string str "\n")
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
411 "$"))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
412
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
413
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
414 ;; LDAP protocol functions
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
415
398
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
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
421 (defun ldap-decode-attribute (attr)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
422 "Decode the attribute/value pair ATTR according to LDAP rules.
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
423 The attribute name is looked up in `ldap-attribute-syntaxes-alist'
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
424 and the corresponding decoder is then retrieved from
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
425 `ldap-attribute-syntax-decoders' and applied on the value(s)."
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
426 (let* ((name (car attr))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
427 (values (cdr attr))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
428 (syntax-id (cdr (assq (intern (downcase name))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
429 ldap-attribute-syntaxes-alist)))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
430 decoder)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
431 (if syntax-id
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
432 (setq decoder (aref ldap-attribute-syntax-decoders
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
433 (1- syntax-id)))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
434 (setq decoder ldap-default-attribute-decoder))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
435 (if decoder
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
436 (cons name (mapcar decoder values))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
437 attr)))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
438
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
439
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 400
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.
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
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
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
457 (setq host ldap-default-host)
400
a86b2b5e0111 Import from CVS: tag r21-2-30
cvs
parents: 398
diff changeset
458 (error "No LDAP host specified"))
a86b2b5e0111 Import from CVS: tag r21-2-30
cvs
parents: 398
diff changeset
459 (let ((host-plist (cdr (assoc host ldap-host-parameters-alist)))
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
460 ldap
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
461 result)
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 400
diff changeset
462 (message "Opening LDAP connection to %s..." host)
400
a86b2b5e0111 Import from CVS: tag r21-2-30
cvs
parents: 398
diff changeset
463 (setq ldap (ldap-open host host-plist))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 400
diff changeset
464 (message "Searching with LDAP on %s..." host)
414
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
465 (setq result (ldap-search-internal ldap filter
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
466 (plist-get host-plist 'base)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
467 (plist-get host-plist 'scope)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
468 attributes attrsonly withdn))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
469 (ldap-close ldap)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
470 (if ldap-ignore-attribute-codings
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
471 result
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
472 (mapcar (function
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
473 (lambda (record)
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
474 (mapcar 'ldap-decode-attribute record)))
da8ed4261e83 Import from CVS: tag r21-2-15
cvs
parents: 412
diff changeset
475 result))))
400
a86b2b5e0111 Import from CVS: tag r21-2-30
cvs
parents: 398
diff changeset
476
388
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