]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapcompare.1
2fc5ada827d40aac4809f34195db901d5596c10c
[openldap] / doc / man / man1 / ldapcompare.1
1 .TH LDAPCOMPARE 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2011 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 \-n ]
11 [\c
12 .BR \-v ]
13 [\c
14 .BR \-z ]
15 [\c
16 .BR \-M [ M ]]
17 [\c
18 .BI \-d \ debuglevel\fR]
19 [\c
20 .BI \-D \ binddn\fR]
21 [\c
22 .BR \-W ]
23 [\c
24 .BI \-w \ passwd\fR]
25 [\c
26 .BI \-y \ passwdfile\fR]
27 [\c
28 .BI \-H \ ldapuri\fR]
29 [\c
30 .BI \-h \ ldaphost\fR]
31 [\c
32 .BI \-p \ ldapport\fR]
33 [\c
34 .BR \-P \ { 2 \||\| 3 }]
35 [\c
36 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
37 [\c
38 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]]
39 [\c
40 .BI \-O \ security-properties\fR]
41 [\c
42 .BR \-I ]
43 [\c
44 .BR \-Q ]
45 [\c
46 .BI \-U \ authcid\fR]
47 [\c
48 .BI \-R \ realm\fR]
49 [\c
50 .BR \-x ]
51 [\c
52 .BI \-X \ authzid\fR]
53 [\c
54 .BI \-Y \ mech\fR]
55 [\c
56 .BR \-Z [ Z ]]
57 .IR DN
58 {\c
59 .BI attr: value
60 |
61 .BI attr:: b64value\fR}
62 .SH DESCRIPTION
63 .I ldapcompare
64 is a shell-accessible interface to the
65 .BR ldap_compare_ext (3)
66 library call.
67 .LP
68 .B ldapcompare
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.
77 .LP
78 .SH OPTIONS
79 .TP
80 .B \-n
81 Show what would be done, but don't actually perform the compare.  Useful for
82 debugging in conjunction with \fB\-v\fP.
83 .TP
84 .B \-v
85 Run in verbose mode, with many diagnostics written to standard output.
86 .TP
87 .B \-z
88 Run in quiet mode, no output is written.  You must check the return
89 status.  Useful in shell scripts.
90 .TP
91 .BR \-M [ M ]
92 Enable manage DSA IT control.
93 .B \-MM
94 makes control critical.
95 .TP
96 .BI \-d \ debuglevel
97 Set the LDAP debugging level to \fIdebuglevel\fP.
98 .B ldapcompare
99 must be compiled with LDAP_DEBUG defined for this option to have any effect.
100 .TP
101 .B \-x 
102 Use simple authentication instead of SASL.
103 .TP
104 .BI \-D \ binddn
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.
107 .TP
108 .B \-W
109 Prompt for simple authentication.
110 This is used instead of specifying the password on the command line.
111 .TP
112 .BI \-w \ passwd
113 Use \fIpasswd\fP as the password for simple authentication.
114 .TP
115 .BI \-y \ passwdfile
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
122 .BR echo (1)
123 will not behave as expected, since
124 .BR echo (1)
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
128 .BR slappasswd (8)
129 with \fI{CLEARTEXT}\fP as hash and the option \fB\-n\fP.
130 .TP
131 .BI \-H \ ldapuri
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
134 is expected.
135 .TP
136 .BI \-h \ ldaphost
137 Specify an alternate host on which the ldap server is running.
138 Deprecated in favor of \fB\-H\fP.
139 .TP
140 .BI \-p \ ldapport
141 Specify an alternate TCP port where the ldap server is listening.
142 Deprecated in favor of \fB\-H\fP.
143 .TP
144 .BR \-P \ { 2 \||\| 3 }
145 Specify the LDAP protocol version to use.
146 .TP
147 .BR \-e \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
148 .TP
149 .BR \-E \ [ ! ] \fIext\fP [ =\fIextparam\fP ]
150
151 Specify general extensions with \fB\-e\fP and search extensions with \fB\-E\fP.
152 \'\fB!\fP\' indicates criticality.
153
154 General extensions:
155 .nf
156   [!]assert=<filter>   (an RFC 4515 Filter)
157   [!]authzid=<authzid> ("dn:<dn>" or "u:<user>")
158   [!]manageDSAit
159   [!]noop
160   ppolicy
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)
164 .fi
165
166 Search extensions:
167 .nf
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)
175 .fi
176 .TP
177 .BI \-O \ security-properties
178 Specify SASL security properties.
179 .TP
180 .B \-I
181 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
182 only as needed.
183 .TP
184 .B \-Q
185 Enable SASL Quiet mode.  Never prompt.
186 .TP
187 .BI \-U \ authcid
188 Specify the authentication ID for SASL bind. The form of the ID
189 depends on the actual SASL mechanism used.
190 .TP
191 .BI \-R \ realm
192 Specify the realm of authentication ID for SASL bind. The form of the realm
193 depends on the actual SASL mechanism used.
194 .TP
195 .BI \-X \ authzid
196 Specify the requested authorization ID for SASL bind.
197 .I authzid
198 must be one of the following formats:
199 .BI dn: "<distinguished name>"
200 or
201 .BI u: <username>
202 .TP
203 .BI \-Y \ mech
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.
206 .TP
207 .BR \-Z [ Z ]
208 Issue StartTLS (Transport Layer Security) extended operation. If you use
209 \fB\-ZZ\fP, the command will require the operation to be successful.
210 .SH EXAMPLES
211 .nf
212     ldapcompare "uid=babs,dc=example,dc=com"  sn:Jensen
213     ldapcompare "uid=babs,dc=example,dc=com"  sn::SmVuc2Vu
214 .fi
215 are all equivalent.
216 .SH LIMITATIONS
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
220 the value from.
221 .SH "SEE ALSO"
222 .BR ldap.conf (5),
223 .BR ldif (5),
224 .BR ldap (3),
225 .BR ldap_compare_ext (3)
226 .SH AUTHOR
227 The OpenLDAP Project <http://www.openldap.org/>
228 .SH ACKNOWLEDGEMENTS
229 .so ../Project