]> git.sur5r.net Git - openldap/blob - doc/man/man1/ldapcompare.1
2de69dd1a0a9adef501c25044884a40902b4821a
[openldap] / doc / man / man1 / ldapcompare.1
1 .TH LDAPCOMPARE 1 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" $OpenLDAP$
3 .\" Copyright 1998-2009 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 .BI \-O \ security-properties\fR]
37 [\c
38 .BR \-I ]
39 [\c
40 .BR \-Q ]
41 [\c
42 .BI \-U \ authcid\fR]
43 [\c
44 .BI \-R \ realm\fR]
45 [\c
46 .BR \-x ]
47 [\c
48 .BI \-X \ authzid\fR]
49 [\c
50 .BI \-Y \ mech\fR]
51 [\c
52 .BR \-Z [ Z ]]
53 .IR DN
54 {\c
55 .BI attr: value
56 |
57 .BI attr:: b64value\fR}
58 .SH DESCRIPTION
59 .I ldapcompare
60 is a shell-accessible interface to the
61 .BR ldap_compare_ext (3)
62 library call.
63 .LP
64 .B ldapcompare
65 opens a connection to an LDAP server, binds, and performs a compare
66 using specified parameters.   The \fIDN\fP should be a distinguished
67 name in the directory.  \fIAttr\fP should be a known attribute.  If
68 followed by one colon, the assertion \fIvalue\fP should be provided
69 as a string.  If followed by two colons, the base64 encoding of the
70 value is provided.  The result code of the compare is provided as
71 the exit code and, unless ran with \fB\-z\fP, the program prints
72 TRUE, FALSE, or UNDEFINED on standard output.
73 .LP
74 .SH OPTIONS
75 .TP
76 .B \-n
77 Show what would be done, but don't actually perform the compare.  Useful for
78 debugging in conjunction with \fB\-v\fP.
79 .TP
80 .B \-v
81 Run in verbose mode, with many diagnostics written to standard output.
82 .TP
83 .B \-z
84 Run in quiet mode, no output is written.  You must check the return
85 status.  Useful in shell scripts.
86 .TP
87 .BR \-M [ M ]
88 Enable manage DSA IT control.
89 .B \-MM
90 makes control critical.
91 .TP
92 .BI \-d \ debuglevel
93 Set the LDAP debugging level to \fIdebuglevel\fP.
94 .B ldapcompare
95 must be compiled with LDAP_DEBUG defined for this option to have any effect.
96 .TP
97 .B \-x 
98 Use simple authentication instead of SASL.
99 .TP
100 .BI \-D \ binddn
101 Use the Distinguished Name \fIbinddn\fP to bind to the LDAP directory.
102 For SASL binds, the server is expected to ignore this value.
103 .TP
104 .B \-W
105 Prompt for simple authentication.
106 This is used instead of specifying the password on the command line.
107 .TP
108 .BI \-w \ passwd
109 Use \fIpasswd\fP as the password for simple authentication.
110 .TP
111 .BI \-y \ passwdfile
112 Use complete contents of \fIpasswdfile\fP as the password for
113 simple authentication.
114 Note that \fIcomplete\fP means that any leading or trailing whitespaces,
115 including newlines, will be considered part of the password and,
116 unlike other software, they will not be stripped.
117 As a consequence, passwords stored in files by commands like
118 .BR echo (1)
119 will not behave as expected, since
120 .BR echo (1)
121 by default appends a trailing newline to the echoed string.
122 The recommended portable way to store a cleartext password in a file
123 for use with this option is to use
124 .BR slappasswd (8)
125 with \fI{CLEARTEXT}\fP as hash and the option \fB\-n\fP.
126 .TP
127 .BI \-H \ ldapuri
128 Specify URI(s) referring to the ldap server(s); only the protocol/host/port
129 fields are allowed; a list of URI, separated by whitespace or commas
130 is expected.
131 .TP
132 .BI \-h \ ldaphost
133 Specify an alternate host on which the ldap server is running.
134 Deprecated in favor of \fB\-H\fP.
135 .TP
136 .BI \-p \ ldapport
137 Specify an alternate TCP port where the ldap server is listening.
138 Deprecated in favor of \fB\-H\fP.
139 .TP
140 .BR \-P \ { 2 \||\| 3 }
141 Specify the LDAP protocol version to use.
142 .TP
143 .BI \-O \ security-properties
144 Specify SASL security properties.
145 .TP
146 .B \-I
147 Enable SASL Interactive mode.  Always prompt.  Default is to prompt
148 only as needed.
149 .TP
150 .B \-Q
151 Enable SASL Quiet mode.  Never prompt.
152 .TP
153 .BI \-U \ authcid
154 Specify the authentication ID for SASL bind. The form of the ID
155 depends on the actual SASL mechanism used.
156 .TP
157 .BI \-R \ realm
158 Specify the realm of authentication ID for SASL bind. The form of the realm
159 depends on the actual SASL mechanism used.
160 .TP
161 .BI \-X \ authzid
162 Specify the requested authorization ID for SASL bind.
163 .I authzid
164 must be one of the following formats:
165 .BI dn: "<distinguished name>"
166 or
167 .BI u: <username>
168 .TP
169 .BI \-Y \ mech
170 Specify the SASL mechanism to be used for authentication. If it's not
171 specified, the program will choose the best mechanism the server knows.
172 .TP
173 .BR \-Z [ Z ]
174 Issue StartTLS (Transport Layer Security) extended operation. If you use
175 \fB\-ZZ\fP, the command will require the operation to be successful.
176 .SH EXAMPLES
177 .nf
178     ldapcompare "uid=babs,dc=example,dc=com"  sn:Jensen
179     ldapcompare "uid=babs,dc=example,dc=com"  sn::SmVuc2Vu
180 .fi
181 are all equivalent.
182 .SH LIMITATIONS
183 Requiring the value be passed on the command line is limiting
184 and introduces some security concerns.  The command should support
185 a mechanism to specify the location (file name or URL) to read
186 the value from.
187 .SH "SEE ALSO"
188 .BR ldap.conf (5),
189 .BR ldif (5),
190 .BR ldap (3),
191 .BR ldap_compare_ext (3)
192 .SH AUTHOR
193 The OpenLDAP Project <http://www.openldap.org/>
194 .SH ACKNOWLEDGEMENTS
195 .so ../Project