" -P version procotol version (default: 3)\n"
" -Q use SASL Quiet mode\n"
" -R realm SASL realm\n"
-" -U user SASL authentication identity (username)\n"
+" -U authcid SASL authentication identity\n"
" -v run in verbose mode (diagnostics to standard output)\n"
" -w passwd bind passwd (for simple authentication)\n"
" -W prompt for bind passwd\n"
" -x Simple authentication\n"
-" -X id SASL authorization identity (\"dn:<dn>\" or \"u:<user>\")\n"
+" -X authzid SASL authorization identity (\"dn:<dn>\" or \"u:<user>\")\n"
" -Y mech SASL mechanism\n"
" -Z Start TLS request (-ZZ to require successful response)\n"
, prog, (strcmp( prog, "ldapadd" ) ? " is to replace" : "") );
{
char* p;
- for( p = optarg; *p == '\0'; p++ ) {
+ for( p = optarg; *p != '\0'; p++ ) {
*p = '\0';
}
}
(void) SIGNAL( SIGPIPE, SIG_IGN );
#endif
+#ifdef NEW_LOGGING
+ lutil_log_initialize( argc, argv );
+#endif
+
if ( !not ) {
if( ( ldaphost != NULL || ldapport ) && ( ldapuri == NULL ) ) {
if ( verbose ) {
if (version == -1 ) {
- version = 3;
+ version = LDAP_VERSION3;
}
if( ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version )
}
if ( use_tls && ldap_start_tls_s( ld, NULL, NULL ) != LDAP_SUCCESS ) {
+ ldap_perror( ld, "ldap_start_tls" );
if ( use_tls > 1 ) {
- ldap_perror( ld, "ldap_start_tls" );
return( EXIT_FAILURE );
}
- fprintf( stderr, "WARNING: could not start TLS\n" );
}
if (want_bindpw) {
fprintf( stderr, "%s: no attributes to change or add (entry=\"%s\")\n",
prog, dn );
return( LDAP_PARAM_ERROR );
+ }
+
+ for ( i = 0; pmods[ i ] != NULL; ++i ) {
+ op = pmods[ i ]->mod_op & ~LDAP_MOD_BVALUES;
+ if( op == LDAP_MOD_ADD && ( pmods[i]->mod_bvalues == NULL )) {
+ fprintf( stderr,
+ "%s: attribute \"%s\" has no values (entry=\"%s\")\n",
+ prog, pmods[i]->mod_type, dn );
+ return LDAP_PARAM_ERROR;
+ }
}
if ( verbose ) {