]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapcompare.1
Happy New Year!
[openldap] / doc / man / man1 / ldapcompare.1
1 .TH LDAPCOMPARE 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2016 The OpenLDAP Foundation All Rights Reserved.
4 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
5 .SH NAME
6 ldapcompare \- LDAP compare tool
7 .SH SYNOPSIS
8 .B ldapcompare
9 [\c
10 .BR \-V [ V ]]
11 [\c
12 .BI \-d \ debuglevel\fR]
13 [\c
14 .BR \-n ]
15 [\c
16 .BR \-v ]
17 [\c
18 .BR \-z ]
19 [\c
20 .BR \-M [ M ]]
21 [\c
22 .BR \-x ]
23 [\c
24 .BI \-D \ binddn\fR]
25 [\c
26 .BR \-W ]
27 [\c
28 .BI \-w \ passwd\fR]
29 [\c
30 .BI \-y \ passwdfile\fR]
31 [\c
32 .BI \-H \ ldapuri\fR]
33 [\c
34 .BI \-h \ ldaphost\fR]
35 [\c
36 .BI \-p \ ldapport\fR]
37 [\c
38 .BR \-P \ { 2 \||\| 3 }]
39 [\c
40 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
41 [\c
42 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
43 [\c
44 .BI \-o \ opt \fR[= optparam \fR]]
45 [\c
46 .BI \-O \ security-properties\fR]
47 [\c
48 .BR \-I ]
49 [\c
50 .BR \-Q ]
51 [\c
52 .BR \-N ]
53 [\c
54 .BI \-U \ authcid\fR]
55 [\c
56 .BI \-R \ realm\fR]
57 [\c
58 .BI \-X \ authzid\fR]
59 [\c
60 .BI \-Y \ mech\fR]
61 [\c
62 .BR \-Z [ Z ]]
63 .IR DN
64 {\c
65 .BI attr: value
66 |
67 .BI attr:: b64value\fR}
68 .SH DESCRIPTION
69 .I ldapcompare
70 is a shell-accessible interface to the
71 .BR ldap_compare_ext (3)
72 library call.
73 .LP
74 .B ldapcompare
75 opens a connection to an LDAP server, binds, and performs a compare
76 using specified parameters.   The \fIDN\fP should be a distinguished
77 name in the directory.  \fIAttr\fP should be a known attribute.  If
78 followed by one colon, the assertion \fIvalue\fP should be provided
79 as a string.  If followed by two colons, the base64 encoding of the
80 value is provided.  The result code of the compare is provided as
81 the exit code and, unless ran with \fB\-z\fP, the program prints
82 TRUE, FALSE, or UNDEFINED on standard output.
83 .LP
84 .SH OPTIONS
85 .TP
86 .BR \-V [ V ]
87 Print version info.
88 If \fB\-VV\fP is given, only the version information is printed.
89 .TP
90 .BI \-d \ debuglevel
91 Set the LDAP debugging level to \fIdebuglevel\fP.
92 .B ldapcompare
93 must be compiled with LDAP_DEBUG defined for this option to have any effect.
94 .TP
95 .B \-n
96 Show what would be done, but don't actually perform the compare.  Useful for
97 debugging in conjunction with \fB\-v\fP.
98 .TP
99 .B \-v
100 Run in verbose mode, with many diagnostics written to standard output.
101 .TP
102 .B \-z
103 Run in quiet mode, no output is written.  You must check the return
104 status.  Useful in shell scripts.
105 .TP
106 .BR \-M [ M ]
107 Enable manage DSA IT control.
108 .B \-MM
109 makes control critical.
110 .TP
111 .B \-x 
112 Use simple authentication instead of SASL.
113 .TP
114 .BI \-D \ binddn
115 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
116 For SASL binds, the server is expected to ignore this value.
117 .TP
118 .B \-W
119 Prompt for simple authentication.
120 This is used instead of specifying the password on the command line.
121 .TP
122 .BI \-w \ passwd
123 Use \fIpasswd\fP as the password for simple authentication.
124 .TP
125 .BI \-y \ passwdfile
126 Use complete contents of \fIpasswdfile\fP as the password for
127 simple authentication.
128 Note that \fIcomplete\fP means that any leading or trailing whitespaces,
129 including newlines, will be considered part of the password and,
130 unlike other software, they will not be stripped.
131 As a consequence, passwords stored in files by commands like
132 .BR echo (1)
133 will not behave as expected, since
134 .BR echo (1)
135 by default appends a trailing newline to the echoed string.
136 The recommended portable way to store a cleartext password in a file
137 for use with this option is to use
138 .BR slappasswd (8)
139 with \fI{CLEARTEXT}\fP as hash and the option \fB\-n\fP.
140 .TP
141 .BI \-H \ ldapuri
142 Specify URI(s) referring to the ldap server(s); only the protocol/host/port
143 fields are allowed; a list of URI, separated by whitespace or commas
144 is expected.
145 .TP
146 .BI \-h \ ldaphost
147 Specify an alternate host on which the ldap server is running.
148 Deprecated in favor of \fB\-H\fP.
149 .TP
150 .BI \-p \ ldapport
151 Specify an alternate TCP port where the ldap server is listening.
152 Deprecated in favor of \fB\-H\fP.
153 .TP
154 .BR \-P \ { 2 \||\| 3 }
155 Specify the LDAP protocol version to use.
156 .TP
157 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
158 .TP
159 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
160
161 Specify general extensions with \fB\-e\fP and compare extensions with \fB\-E\fP.
162 \'\fB!\fP\' indicates criticality.
163
164 General extensions:
165 .nf
166   [!]assert=<filter>    (an RFC 4515 Filter)
167   !authzid=<authzid>    ("dn:<dn>" or "u:<user>")
168   [!]bauthzid           (RFC 3829 authzid control)
169   [!]chaining[=<resolve>[/<cont>]]
170   [!]manageDSAit
171   [!]noop
172   ppolicy
173   [!]postread[=<attrs>] (a comma-separated attribute list)
174   [!]preread[=<attrs>]  (a comma-separated attribute list)
175   [!]relax
176   sessiontracking[=<username>]
177   abandon,cancel,ignore (SIGINT sends abandon/cancel,
178   or ignores response; if critical, doesn't wait for SIGINT.
179   not really controls)
180 .fi
181
182 Compare extensions:
183 .nf
184   !dontUseCopy
185 .fi
186 .TP
187 .BI \-o \ opt \fR[= optparam \fR]
188
189 Specify general options.
190
191 General options:
192 .nf
193   nettimeout=<timeout>  (in seconds, or "none" or "max")
194   ldif-wrap=<width>     (in columns, or "no" for no wrapping)
195 .fi
196 .TP
197 .BI \-O \ security-properties
198 Specify SASL security properties.
199 .TP
200 .B \-I
201 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
202 only as needed.
203 .TP
204 .B \-Q
205 Enable SASL Quiet mode.  Never prompt.
206 .TP
207 .B \-N
208 Do not use reverse DNS to canonicalize SASL host name.
209 .TP
210 .BI \-U \ authcid
211 Specify the authentication ID for SASL bind. The form of the ID
212 depends on the actual SASL mechanism used.
213 .TP
214 .BI \-R \ realm
215 Specify the realm of authentication ID for SASL bind. The form of the realm
216 depends on the actual SASL mechanism used.
217 .TP
218 .BI \-X \ authzid
219 Specify the requested authorization ID for SASL bind.
220 .I authzid
221 must be one of the following formats:
222 .BI dn: "<distinguished name>"
223 or
224 .BI u: <username>
225 .TP
226 .BI \-Y \ mech
227 Specify the SASL mechanism to be used for authentication. If it's not
228 specified, the program will choose the best mechanism the server knows.
229 .TP
230 .BR \-Z [ Z ]
231 Issue StartTLS (Transport Layer Security) extended operation. If you use
232 \fB\-ZZ\fP, the command will require the operation to be successful.
233 .SH EXAMPLES
234 .nf
235     ldapcompare "uid=babs,dc=example,dc=com"  sn:Jensen
236     ldapcompare "uid=babs,dc=example,dc=com"  sn::SmVuc2Vu
237 .fi
238 are all equivalent.
239 .SH LIMITATIONS
240 Requiring the value be passed on the command line is limiting
241 and introduces some security concerns.  The command should support
242 a mechanism to specify the location (file name or URL) to read
243 the value from.
244 .SH "SEE ALSO"
245 .BR ldap.conf (5),
246 .BR ldif (5),
247 .BR ldap (3),
248 .BR ldap_compare_ext (3)
249 .SH AUTHOR
250 The OpenLDAP Project <http://www.openldap.org/>
251 .SH ACKNOWLEDGEMENTS
252 .so ../Project