if ( cr ){
snprintf( cr->msg, sizeof(cr->msg),
"slapo-ppolicy cannot be global" );
- fprintf( stderr, "%s\n", cr->msg );
+ Debug( LDAP_DEBUG_ANY, "%s\n", cr->msg, 0, 0 );
}
return 1;
}
snprintf( cr->msg, sizeof(cr->msg),
"User Schema load failed for attribute \"%s\". Error code %d: %s",
pwd_UsSchema[i].def, code, err );
- fprintf( stderr, "%s\n", cr->msg );
+ Debug( LDAP_DEBUG_ANY, "%s\n", cr->msg, 0, 0 );
}
return code;
}
SLAP_CTRL_ADD|SLAP_CTRL_BIND|SLAP_CTRL_MODIFY|SLAP_CTRL_HIDE, extops,
ppolicy_parseCtrl, &ppolicy_cid );
if ( code != LDAP_SUCCESS ) {
- fprintf( stderr, "Failed to register control %d\n", code );
+ Debug( LDAP_DEBUG_ANY, "Failed to register control %d\n", code, 0, 0 );
return code;
}
#if 0
ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
/* too late, c_mutex released */
- fprintf( stderr, "*** DN: \"%s\" => \"%s\"\n",
+ Debug( LDAP_DEBUG_ANY, "*** DN: \"%s\" => \"%s\"\n",
op->o_conn->c_ndn.bv_val,
op->o_req_ndn.bv_val );
ber_bvreplace( &op->o_conn->c_ndn,
*/
if ( argc == 2 ) {
if ( be->be_suffix == NULL ) {
- fprintf( stderr, "%s: line %d: "
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: "
" \"suffixMassage [<suffix>]"
" <massaged suffix>\" without "
"<suffix> part requires database "
"suffix be defined first.\n",
- fname, lineno );
+ fname, lineno, 0 );
return 1;
}
bvnc = be->be_suffix[ 0 ];
massaged = 2;
} else {
- fprintf( stderr, "%s: line %d: syntax is"
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: syntax is"
" \"suffixMassage [<suffix>]"
" <massaged suffix>\"\n",
- fname, lineno );
+ fname, lineno, 0 );
return 1;
}
if ( dnPrettyNormal( NULL, &bvnc, &pvnc, &nvnc, NULL ) != LDAP_SUCCESS ) {
- fprintf( stderr, "%s: line %d: suffix DN %s is invalid\n",
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix DN %s is invalid\n",
fname, lineno, bvnc.bv_val );
return 1;
}
ber_str2bv( argv[ massaged ], 0, 0, &brnc );
if ( dnPrettyNormal( NULL, &brnc, &prnc, &nrnc, NULL ) != LDAP_SUCCESS ) {
- fprintf( stderr, "%s: line %d: suffix DN %s is invalid\n",
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: suffix DN %s is invalid\n",
fname, lineno, brnc.bv_val );
free( nvnc.bv_val );
free( pvnc.bv_val );
} else if ( strcasecmp( argv[0], "t-f-support" ) == 0 ) {
if ( argc != 2 ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: \"t-f-support {no|yes|discover}\" needs 1 argument.\n",
- fname, lineno );
+ fname, lineno, 0 );
return( 1 );
}
/* TODO: not implemented yet */
} else if ( strcasecmp( argv[ 1 ], "discover" ) == 0 ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: \"discover\" not supported yet "
"in \"t-f-support {no|yes|discover}\".\n",
- fname, lineno );
+ fname, lineno, 0 );
return( 1 );
#if 0
rwmap->rwm_flags |= RWM_F_SUPPORT_T_F_DISCOVER;
#endif
} else {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: unknown value \"%s\" for \"t-f-support {no|yes|discover}\".\n",
fname, lineno, argv[ 1 ] );
return 1;
} else if ( strcasecmp( argv[0], "normalize-mapped-attrs" ) == 0 ) {
if ( argc !=2 ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: \"normalize-mapped-attrs {no|yes}\" needs 1 argument.\n",
- fname, lineno );
+ fname, lineno, 0 );
return( 1 );
}
int rc = 0;
if ( argc < 3 || argc > 4 ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: syntax is \"map {objectclass | attribute} [<local> | *] {<foreign> | *}\"\n",
- fname, lineno );
+ fname, lineno, 0 );
return 1;
}
map = at_map;
} else {
- fprintf( stderr, "%s: line %d: syntax is "
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: syntax is "
"\"map {objectclass | attribute} [<local> | *] "
"{<foreign> | *}\"\n",
- fname, lineno );
+ fname, lineno, 0 );
return 1;
}
&& ( strcasecmp( src, "objectclass" ) == 0
|| strcasecmp( dst, "objectclass" ) == 0 ) )
{
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: objectclass attribute cannot be mapped\n",
- fname, lineno );
+ fname, lineno, 0 );
return 1;
}
mapping = (struct ldapmapping *)ch_calloc( 2,
sizeof(struct ldapmapping) );
if ( mapping == NULL ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: out of memory\n",
- fname, lineno );
+ fname, lineno, 0 );
return 1;
}
ber_str2bv( src, 0, 1, &mapping[0].m_src );
if ( src[0] != '\0' ) {
mapping[0].m_src_oc = oc_bvfind( &mapping[0].m_src );
if ( mapping[0].m_src_oc == NULL ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: warning, source objectClass '%s' "
"should be defined in schema\n",
fname, lineno, src );
mapping[0].m_dst_oc = oc_bvfind( &mapping[0].m_dst );
if ( mapping[0].m_dst_oc == NULL ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: warning, destination objectClass '%s' "
"is not defined in schema\n",
fname, lineno, dst );
mapping[0].m_dst_oc = oc_bvfind_undef( &mapping[0].m_dst );
if ( mapping[0].m_dst_oc == NULL ) {
- fprintf( stderr, "%s: line %d: unable to mimic destination objectClass '%s'\n",
+ Debug( LDAP_DEBUG_ANY, "%s: line %d: unable to mimic destination objectClass '%s'\n",
fname, lineno, dst );
goto error_return;
}
rc = slap_bv2ad( &mapping[0].m_src,
&mapping[0].m_src_ad, &text );
if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: warning, source attributeType '%s' "
"should be defined in schema\n",
fname, lineno, src );
&mapping[0].m_src_ad, &text,
SLAP_AD_PROXIED );
if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr,
- "%s: line %d: source attributeType '%s': %d (%s)\n",
- fname, lineno, src, rc, text ? text : "null" );
+ char prefix[1024];
+ snprintf( prefix, sizeof(prefix),
+ "%s: line %d: source attributeType '%s': %d",
+ fname, lineno, src, rc );
+ Debug( LDAP_DEBUG_ANY, "%s (%s)\n",
+ prefix, text ? text : "null", 0 );
goto error_return;
}
rc = slap_bv2ad( &mapping[0].m_dst, &mapping[0].m_dst_ad, &text );
if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: warning, destination attributeType '%s' "
"is not defined in schema\n",
fname, lineno, dst );
&mapping[0].m_dst_ad, &text,
SLAP_AD_PROXIED );
if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr,
- "%s: line %d: destination attributeType '%s': %d (%s)\n",
- fname, lineno, dst, rc, text ? text : "null" );
+ char prefix[1024];
+ snprintf( prefix, sizeof(prefix),
+ "%s: line %d: destination attributeType '%s': %d",
+ fname, lineno, dst, rc );
+ Debug( LDAP_DEBUG_ANY, "%s (%s)\n",
+ prefix, text ? text : "null", 0 );
goto error_return;
}
}
if ( ( src[0] != '\0' && avl_find( map->map, (caddr_t)mapping, rwm_mapping_cmp ) != NULL)
|| avl_find( map->remap, (caddr_t)&mapping[1], rwm_mapping_cmp ) != NULL)
{
- fprintf( stderr,
+ Debug( LDAP_DEBUG_ANY,
"%s: line %d: duplicate mapping found.\n",
- fname, lineno );
+ fname, lineno, 0 );
/* FIXME: free stuff */
goto error_return;
}
if ( rc == LDAP_SUCCESS ) {
rc = overlay_register( &sssvlv );
if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr, "Failed to register server side sort overlay\n" );
+ Debug( LDAP_DEBUG_ANY, "Failed to register server side sort overlay\n", 0, 0, 0 );
}
}
else {
- fprintf( stderr, "Failed to register control %d\n", rc );
+ Debug( LDAP_DEBUG_ANY, "Failed to register control %d\n", rc, 0, 0 );
}
return rc;
SLAP_CTRL_SEARCH | SLAP_CTRL_HIDE, NULL, valsort_parseCtrl,
&valsort_cid );
if ( rc != LDAP_SUCCESS ) {
- fprintf( stderr, "Failed to register control %d\n", rc );
+ Debug( LDAP_DEBUG_ANY, "Failed to register control %d\n", rc, 0, 0 );
return rc;
}