N_(" [!]assert=<filter> (an RFC 2254 Filter)\n")
N_(" [!]authzid=<authzid> (\"dn:<dn>\" or \"u:<user>\")\n")
N_(" [!]manageDSAit\n")
-N_(" [!]noop\n")
+N_(" [!]noop\n"),
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
N_(" ppolicy\n"),
+#endif
N_(" [!]postread[=<attrs>] (a comma-separated attribute list)\n"),
N_(" [!]preread[=<attrs>] (a comma-separated attribute list)\n"),
N_(" -f file read operations from `file'\n"),
fputs( _("Common options:\n"), stderr );
for( cpp = descriptions; *cpp != NULL; cpp++ ) {
- if( strchr( options, (*cpp)[3] ) ) {
+ if( strchr( options, (*cpp)[3] ) || (*cpp)[3] == ' ' ) {
fputs( _(*cpp), stderr );
}
}
noop = 1 + crit;
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
} else if ( strcasecmp( control, "ppolicy" ) == 0 ) {
if( ppolicy ) {
fprintf( stderr, "ppolicy control previously specified\n");
}
ppolicy = 1;
+#endif
} else if ( strcasecmp( control, "preread" ) == 0 ) {
if( preread ) {
void
tool_bind( LDAP *ld )
{
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
if ( ppolicy ) {
LDAPControl *ctrls[2], c;
c.ldctl_oid = LDAP_CONTROL_PASSWORDPOLICYREQUEST;
ctrls[1] = NULL;
ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, ctrls );
}
+#endif
if ( authmethod == LDAP_AUTH_SASL ) {
#ifdef HAVE_CYRUS_SASL
exit( EXIT_FAILURE );
}
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
if ( ctrls && ppolicy ) {
LDAPControl *ctrl;
int expire, grace;
}
}
}
+#endif
if ( err != LDAP_SUCCESS ) {
- fprintf( stderr, "ldap_bind result: %s\n", ldap_err2string( err ));
+ fprintf( stderr, "ldap_bind: %s\n", ldap_err2string( err ));
exit( EXIT_FAILURE );
}
}
i++;
}
+#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
if ( ppolicy ) {
c[i].ldctl_oid = LDAP_CONTROL_PASSWORDPOLICYREQUEST;
c[i].ldctl_value.bv_val = NULL;
ctrls[i] = &c[i];
i++;
}
+#endif
if ( preread ) {
char berbuf[LBER_ELEMENT_SIZEOF];