This patch takes care of /most/ of the normal SASL use cases.
I have not tested rebinds or any reconnection feature.
As well, I do not know what the patch's effect on simple bind is.
Simple binds should work as well, but I don't use simple binds.
The SASL implementation is borrowed from OpenLDAP's client tools
and seems to work well with any command-line based application.
diff -urN ldapvi-1.5/arguments.c arguments.c
--- ldapvi-1.5/arguments.c 2005-12-11 09:25:30.000000000 -0800
+++ arguments.c 2005-12-22 12:06:53.000000000 -0800
" -q, --quiet Disable progress output.\n" \
" -v, --verbose Note every update.\n" \
" -!, --noquestions Don't ask for confirmation.\n" \
+" -I, --sasl_interactive Use SASL Interactive mode.\n" \
+" -Q, --sasl_quiet use SASL Quiet mode.\n" \
+" -O, --sasl_secprops P SASL security properties.\n" \
+" -r, --sasl_realm R SASL realm.\n" \
+" -U, --sasl_authcid AC SASL authentication identity.\n" \
+" -X, --sasl_authzid AZ SASL authorization identity.\n" \
+" -Y, --sasl_mech MECH SASL Mechanism.\n" \
" -H, --help This help.\n" \
"Environment variables: VISUAL, EDITOR, PAGER.\n" \
{"scope", 's', POPT_ARG_STRING, 0, 's', 0, 0},
{"base", 'b', POPT_ARG_STRING, 0, 'b', 0, 0},
{"user", 'D', POPT_ARG_STRING, 0, 'D', 0, 0},
+ {"sasl_interactive",'I',0, 0, 'I', 0, 0},
+ {"sasl_quiet" ,'Q',0, 0, 'Q', 0, 0},
+ {"sasl_secprops",'O', POPT_ARG_STRING, 0, 'O', 0, 0},
+ {"sasl_realm", 'r', POPT_ARG_STRING, 0, 'r', 0, 0},
+ {"sasl_mech", 'Y', POPT_ARG_STRING, 0, 'Y', 0, 0},
+ {"sasl_authzid",'X', POPT_ARG_STRING, 0, 'X', 0, 0},
+ {"sasl_authcid",'U', POPT_ARG_STRING, 0, 'U', 0, 0},
+ {"sasl_realm", 'r', POPT_ARG_STRING, 0, 'r', 0, 0},
{"password", 'w', POPT_ARG_STRING, 0, 'w', 0, 0},
{"chase", 'C', POPT_ARG_STRING, 0, 'C', 0, 0},
{"deref", 'a', POPT_ARG_STRING, 0, 'a', 0, 0},
-parse_arguments(int argc, const char **argv, cmdline *result, GPtrArray *ctrls)
+parse_arguments(int argc,
+ bind_auth_options *auth_opt,