1 .TH LDAPCOMPARE 1 "RELEASEDATE" "OpenLDAP LDVERSION"
3 .\" Copyright 1998-2009 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
6 ldapcompare \- LDAP compare tool
18 .BI \-d \ debuglevel\fR]
26 .BI \-y \ passwdfile\fR]
30 .BI \-h \ ldaphost\fR]
32 .BI \-p \ ldapport\fR]
34 .BR \-P \ { 2 \||\| 3 }]
36 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
38 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
40 .BI \-O \ security-properties\fR]
61 .BI attr:: b64value\fR}
64 is a shell-accessible interface to the
65 .BR ldap_compare_ext (3)
69 opens a connection to an LDAP server, binds, and performs a compare
70 using specified parameters. The \fIDN\fP should be a distinguished
71 name in the directory. \fIAttr\fP should be a known attribute. If
72 followed by one colon, the assertion \fIvalue\fP should be provided
73 as a string. If followed by two colons, the base64 encoding of the
74 value is provided. The result code of the compare is provided as
75 the exit code and, unless ran with \fB\-z\fP, the program prints
76 TRUE, FALSE, or UNDEFINED on standard output.
81 Show what would be done, but don't actually perform the compare. Useful for
82 debugging in conjunction with \fB\-v\fP.
85 Run in verbose mode, with many diagnostics written to standard output.
88 Run in quiet mode, no output is written. You must check the return
89 status. Useful in shell scripts.
92 Enable manage DSA IT control.
94 makes control critical.
97 Set the LDAP debugging level to \fIdebuglevel\fP.
99 must be compiled with LDAP_DEBUG defined for this option to have any effect.
102 Use simple authentication instead of SASL.
105 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
106 For SASL binds, the server is expected to ignore this value.
109 Prompt for simple authentication.
110 This is used instead of specifying the password on the command line.
113 Use \fIpasswd\fP as the password for simple authentication.
116 Use complete contents of \fIpasswdfile\fP as the password for
117 simple authentication.
118 Note that \fIcomplete\fP means that any leading or trailing whitespaces,
119 including newlines, will be considered part of the password and,
120 unlike other software, they will not be stripped.
121 As a consequence, passwords stored in files by commands like
123 will not behave as expected, since
125 by default appends a trailing newline to the echoed string.
126 The recommended portable way to store a cleartext password in a file
127 for use with this option is to use
129 with \fI{CLEARTEXT}\fP as hash and the option \fB\-n\fP.
132 Specify URI(s) referring to the ldap server(s); only the protocol/host/port
133 fields are allowed; a list of URI, separated by whitespace or commas
137 Specify an alternate host on which the ldap server is running.
138 Deprecated in favor of \fB\-H\fP.
141 Specify an alternate TCP port where the ldap server is listening.
142 Deprecated in favor of \fB\-H\fP.
144 .BR \-P \ { 2 \||\| 3 }
145 Specify the LDAP protocol version to use.
147 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
149 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
151 Specify general extensions with \fB\-e\fP and search extensions with \fB\-E\fP.
152 \'\fB!\fP\' indicates criticality.
156 [!]assert=<filter> (an RFC 4515 Filter)
157 [!]authzid=<authzid> ("dn:<dn>" or "u:<user>")
161 [!]postread[=<attrs>] (a comma-separated attribute list)
162 [!]preread[=<attrs>] (a comma-separated attribute list)
163 abandon, cancel (SIGINT sends abandon/cancel; not really controls)
168 [!]domainScope (domain scope)
169 [!]mv=<filter> (matched values filter)
170 [!]pr=<size>[/prompt|noprompt] (paged results/prompt)
171 [!]sss=[\-]<attr[:OID]>[/[\-]<attr[:OID]>...] (server side sorting)
172 [!]subentries[=true|false] (subentries)
173 [!]sync=ro[/<cookie>] (LDAP Sync refreshOnly)
174 rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist)
177 .BI \-O \ security-properties
178 Specify SASL security properties.
181 Enable SASL Interactive mode. Always prompt. Default is to prompt
185 Enable SASL Quiet mode. Never prompt.
188 Specify the authentication ID for SASL bind. The form of the ID
189 depends on the actual SASL mechanism used.
192 Specify the realm of authentication ID for SASL bind. The form of the realm
193 depends on the actual SASL mechanism used.
196 Specify the requested authorization ID for SASL bind.
198 must be one of the following formats:
199 .BI dn: "<distinguished name>"
204 Specify the SASL mechanism to be used for authentication. If it's not
205 specified, the program will choose the best mechanism the server knows.
208 Issue StartTLS (Transport Layer Security) extended operation. If you use
209 \fB\-ZZ\fP, the command will require the operation to be successful.
212 ldapcompare "uid=babs,dc=example,dc=com" sn:Jensen
213 ldapcompare "uid=babs,dc=example,dc=com" sn::SmVuc2Vu
217 Requiring the value be passed on the command line is limiting
218 and introduces some security concerns. The command should support
219 a mechanism to specify the location (file name or URL) to read
225 .BR ldap_compare_ext (3)
227 The OpenLDAP Project <http://www.openldap.org/>