NAME

ldapcompare - LDAP compare tool

SYNOPSIS

ldapcompare [-n] [-v] [-z] [-M[M]] [-d debuglevel] [-D binddn] [-W] [-w passwd] [-y passwdfile] [-H ldapuri] [-h ldaphost] [-p ldapport] [-P 2|_3] [-O security-properties] [-I] [-Q] [-U authcid] [-R realm] [-x] [-X authzid] [-Y mech] [-Z[Z]] DN < attr:value | attr::b64value >

DESCRIPTION

ldapcompare is a shell-accessible interface to the ldap_compare_ext(3) library call.

ldapcompare opens a connection to an LDAP server, binds, and performs a compare using specified parameters. The _D_N should be a distinguished name in the directory. _A_t_t_r should be a known attribute. If followed by one colon, the assertion _v_a_l_u_e should be provided as a string. If followed by two colons, the base64 encoding of the value is provided. The result code of the compare is provided as the exit code and, unless ran with -z, the program prints TRUE, FALSE, or UNDEFINED on standard output.

OPTIONS

-n
Show what would be done, but don't actually perform the compare. Useful for debugging in conjunction with -v.
-v
Run in verbose mode, with many diagnostics written to standard output.
-z
Run in quiet mode, no output is written. You must check the return status. Useful in shell scripts.
-M[M]
Enable manage DSA IT control. -MM makes control critical.
-d debuglevel
Set the LDAP debugging level to _d_e_b_u_g_l_e_v_e_l. ldapcompare must be compiled with LDAP_DEBUG defined for this option to have any effect.
-x
Use simple authentication instead of SASL.
-D binddn
Use the Distinguished Name _b_i_n_d_d_n to bind to the LDAP directory.
-W
Prompt for simple authentication. This is used instead of specifying the password on the command line.
-w passwd
Use _p_a_s_s_w_d as the password for simple authentication.
-y passwdfile
Use complete contents of _p_a_s_s_w_d_f_i_l_e as the password for simple authentication. Note that _c_o_m_p_l_e_t_e means that any leading or trailing whitespaces, including newlines, will be considered part of the password and, unlike other software, they will not be stripped. As a consequence, passwords stored in files by commands like echo(1) will not behave as expected, since echo(1) by default appends a trailing newline to the echoed string. The recommended portable way to store a cleartext password in a file for use with this option is to use slappasswd(8) with _{_C_L_E_A_R_T_E_X_T_} as hash and the option _-_n.
-H ldapuri
Specify URI(s) referring to the ldap server(s); only the protocol/host/port fields are allowed; a list of URI, separated by whitespace or commas is expected.
-h ldaphost
Specify an alternate host on which the ldap server is running. Deprecated in favor of -H.
-p ldapport
Specify an alternate TCP port where the ldap server is listening. Deprecated in favor of -H.
_<_b_>_-_P_<_/_b_>_<_i_> _2|_3_<_/_i_> _<_d_d_> _S_p_e_c_i_f_y _t_h_e _L_D_A_P _p_r_o_t_o_c_o_l _v_e_r_s_i_o_n _t_o _u_s_e_. _<_d_t_> _<_b_>_-_O_<_/_b_>_<_i_> _s_e_c_u_r_i_t_y_-_p_r_o_p_e_r_t_i_e_s_<_/_i_> _<_d_d_> _S_p_e_c_i_f_y _S_A_S_L _s_e_c_u_r_i_t_y _p_r_o_p_e_r_t_i_e_s_. _<_d_t_> _<_b_>_-_I_<_/_b_> _<_d_d_> _E_n_a_b_l_e _S_A_S_L _I_n_t_e_r_a_c_t_i_v_e _m_o_d_e_. _A_l_w_a_y_s _p_r_o_m_p_t_. _D_e_f_a_u_l_t _i_s _t_o _p_r_o_m_p_t _o_n_l_y _a_s _n_e_e_d_e_d_. _<_d_t_> _<_b_>_-_Q_<_/_b_> _<_d_d_> _E_n_a_b_l_e _S_A_S_L _Q_u_i_e_t _m_o_d_e_. _N_e_v_e_r _p_r_o_m_p_t_. _<_d_t_> _<_b_>_-_U_<_/_b_>_<_i_> _a_u_t_h_c_i_d_<_/_i_> _<_d_d_> _S_p_e_c_i_f_y _t_h_e _a_u_t_h_e_n_t_i_c_a_t_i_o_n _I_D _f_o_r _S_A_S_L _b_i_n_d_. _T_h_e _f_o_r_m _o_f _t_h_e _I_D _d_e_p_e_n_d_s _o_n _t_h_e _a_c_t_u_a_l _S_A_S_L _m_e_c_h_a_n_i_s_m _u_s_e_d_. _<_d_t_> _<_b_>_-_R_<_/_b_>_<_i_> _r_e_a_l_m_<_/_i_> _<_d_d_> _S_p_e_c_i_f_y _t_h_e _r_e_a_l_m _o_f _a_u_t_h_e_n_t_i_c_a_t_i_o_n _I_D _f_o_r _S_A_S_L _b_i_n_d_. _T_h_e _f_o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