1LDAPCOMPARE(1) General Commands Manual LDAPCOMPARE(1)
2
3
4
6 ldapcompare - LDAP compare tool
7
9 ldapcompare [-n] [-v] [-z] [-M[M]] [-d debuglevel] [-D binddn] [-W]
10 [-w passwd] [-y passwdfile] [-H ldapuri] [-h ldaphost] [-p ldapport]
11 [-P {2|3}] [-e [!]ext[=extparam]] [-E [!]ext[=extparam]] [-O security-
12 properties] [-I] [-Q] [-U authcid] [-R realm] [-x] [-X authzid]
13 [-Y mech] [-Z[Z]] DN {attr:value | attr::b64value}
14
16 ldapcompare is a shell-accessible interface to the ldap_compare_ext(3)
17 library call.
18
19 ldapcompare opens a connection to an LDAP server, binds, and performs a
20 compare using specified parameters. The DN should be a distinguished
21 name in the directory. Attr should be a known attribute. If followed
22 by one colon, the assertion value should be provided as a string. If
23 followed by two colons, the base64 encoding of the value is provided.
24 The result code of the compare is provided as the exit code and, unless
25 ran with -z, the program prints TRUE, FALSE, or UNDEFINED on standard
26 output.
27
29 -n Show what would be done, but don't actually perform the compare.
30 Useful for debugging in conjunction with -v.
31
32 -v Run in verbose mode, with many diagnostics written to standard
33 output.
34
35 -z Run in quiet mode, no output is written. You must check the
36 return status. Useful in shell scripts.
37
38 -M[M] Enable manage DSA IT control. -MM makes control critical.
39
40 -d debuglevel
41 Set the LDAP debugging level to debuglevel. ldapcompare must be
42 compiled with LDAP_DEBUG defined for this option to have any
43 effect.
44
45 -x Use simple authentication instead of SASL.
46
47 -D binddn
48 Use the Distinguished Name binddn to bind to the LDAP directory.
49 For SASL binds, the server is expected to ignore this value.
50
51 -W Prompt for simple authentication. This is used instead of spec‐
52 ifying the password on the command line.
53
54 -w passwd
55 Use passwd as the password for simple authentication.
56
57 -y passwdfile
58 Use complete contents of passwdfile as the password for simple
59 authentication. Note that complete means that any leading or
60 trailing whitespaces, including newlines, will be considered
61 part of the password and, unlike other software, they will not
62 be stripped. As a consequence, passwords stored in files by
63 commands like echo(1) will not behave as expected, since echo(1)
64 by default appends a trailing newline to the echoed string. The
65 recommended portable way to store a cleartext password in a file
66 for use with this option is to use slappasswd(8) with {CLEART‐
67 EXT} as hash and the option -n.
68
69 -H ldapuri
70 Specify URI(s) referring to the ldap server(s); only the proto‐
71 col/host/port fields are allowed; a list of URI, separated by
72 whitespace or commas is expected.
73
74 -h ldaphost
75 Specify an alternate host on which the ldap server is running.
76 Deprecated in favor of -H.
77
78 -p ldapport
79 Specify an alternate TCP port where the ldap server is listen‐
80 ing. Deprecated in favor of -H.
81
82 -P {2|3}
83 Specify the LDAP protocol version to use.
84
85 -e [!]ext[=extparam]
86
87 -E [!]ext[=extparam]
88
89 Specify general extensions with -e and search extensions with
90 -E. ´!´ indicates criticality.
91
92 General extensions:
93 [!]assert=<filter> (an RFC 4515 Filter)
94 [!]authzid=<authzid> ("dn:<dn>" or "u:<user>")
95 [!]manageDSAit
96 [!]noop
97 ppolicy
98 [!]postread[=<attrs>] (a comma-separated attribute list)
99 [!]preread[=<attrs>] (a comma-separated attribute list)
100 abandon, cancel (SIGINT sends abandon/cancel; not really controls)
101
102 Search extensions:
103 [!]domainScope (domain scope)
104 [!]mv=<filter> (matched values filter)
105 [!]pr=<size>[/prompt|noprompt] (paged results/prompt)
106 [!]sss=[-]<attr[:OID]>[/[-]<attr[:OID]>...] (server side sorting)
107 [!]subentries[=true|false] (subentries)
108 [!]sync=ro[/<cookie>] (LDAP Sync refreshOnly)
109 rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist)
110
111 -O security-properties
112 Specify SASL security properties.
113
114 -I Enable SASL Interactive mode. Always prompt. Default is to
115 prompt only as needed.
116
117 -Q Enable SASL Quiet mode. Never prompt.
118
119 -U authcid
120 Specify the authentication ID for SASL bind. The form of the ID
121 depends on the actual SASL mechanism used.
122
123 -R realm
124 Specify the realm of authentication ID for SASL bind. The form
125 of the realm depends on the actual SASL mechanism used.
126
127 -X authzid
128 Specify the requested authorization ID for SASL bind. authzid
129 must be one of the following formats: dn:<distinguished name> or
130 u:<username>
131
132 -Y mech
133 Specify the SASL mechanism to be used for authentication. If
134 it's not specified, the program will choose the best mechanism
135 the server knows.
136
137 -Z[Z] Issue StartTLS (Transport Layer Security) extended operation. If
138 you use -ZZ, the command will require the operation to be suc‐
139 cessful.
140
142 ldapcompare "uid=babs,dc=example,dc=com" sn:Jensen
143 ldapcompare "uid=babs,dc=example,dc=com" sn::SmVuc2Vu
144 are all equivalent.
145
147 Requiring the value be passed on the command line is limiting and
148 introduces some security concerns. The command should support a mecha‐
149 nism to specify the location (file name or URL) to read the value from.
150
152 ldap.conf(5), ldif(5), ldap(3), ldap_compare_ext(3)
153
155 The OpenLDAP Project <http://www.openldap.org/>
156
158 OpenLDAP Software is developed and maintained by The OpenLDAP Project
159 <http://www.openldap.org/>. OpenLDAP Software is derived from Univer‐
160 sity of Michigan LDAP 3.3 Release.
161
162
163
164OpenLDAP 2.4.23 2010/06/30 LDAPCOMPARE(1)