if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
- "get_ctrls: conn %d get OID failed.\n",
+ "get_ctrls: conn %d get OID failed.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get oid failed.\n",
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
- "get_ctrls: conn %d get crit failed.\n",
+ "get_ctrls: conn %d get crit failed.\n",
conn->c_connid ));
#else
Debug( LDAP_DEBUG_TRACE, "=> get_ctrls: get crit failed.\n",
return p - dn_in->bv_val;
}
-/* rdn_attr_type:
- *
- * Given a string (i.e. an rdn) of the form:
- * "attribute_type = attribute_value"
- * this function returns the type of an attribute, that is the
- * string "attribute_type" which is placed in newly allocated
- * memory. The returned string will be null-terminated.
- *
- * Deprecated
- */
-
-char * rdn_attr_type( const char * s )
-{
- char **attrs = NULL, **values = NULL, *retval;
-
- if ( rdn_attrs( s, &attrs, &values ) != LDAP_SUCCESS ) {
- return NULL;
- }
-
- retval = ch_strdup( attrs[ 0 ] );
-
- charray_free( attrs );
- charray_free( values );
-
- return retval;
-}
-
-
-/* rdn_attr_value:
- *
- * Given a string (i.e. an rdn) of the form:
- * "attribute_type = attribute_value"
- * this function returns "attribute_type" which is placed in newly allocated
- * memory. The returned string will be null-terminated and may contain
- * spaces (i.e. "John Doe\0").
- *
- * Deprecated
- */
-
-char *
-rdn_attr_value( const char * rdn )
-{
- char **values = NULL, *retval;
-
- if ( rdn_attrs( rdn, NULL, &values ) != LDAP_SUCCESS ) {
- return NULL;
- }
-
- retval = ch_strdup( values[ 0 ] );
-
- charray_free( values );
-
- return retval;
-}
-
-
-/* rdn_attrs:
- *
- * Given a string (i.e. an rdn) of the form:
- * "attribute_type=attribute_value[+attribute_type=attribute_value[...]]"
- * this function stores the types of the attributes in ptypes, that is the
- * array of strings "attribute_type" which is placed in newly allocated
- * memory, and the values of the attributes in pvalues, that is the
- * array of strings "attribute_value" which is placed in newly allocated
- * memory. Returns 0 on success, -1 on failure.
- *
- * note: got part of the code from dn_validate
- *
- * Deprecated; directly use LDAPRDN from ldap_str2rdn
- */
-int
-rdn_attrs( const char * rdn, char ***types, char ***values)
-{
- LDAPRDN *tmpRDN;
- const char *p;
- int iAVA;
- int rc;
-
- assert( rdn );
- assert( values );
- assert( *values == NULL );
- assert( types == NULL || *types == NULL );
-
- rc = ldap_str2rdn( rdn, &tmpRDN, (char **)&p, LDAP_DN_FORMAT_LDAP );
- if ( rc != LDAP_SUCCESS ) {
- return rc;
- }
-
-#if 0
- /*
- * FIXME: should we complain if the rdn is actually a dn?
- */
- if ( p[ 0 ] != '\0' ) {
- ldap_rdnfree( tmpRDN );
- return LDAP_INVALID_DN_SYNTAX;
- }
-#endif
-
- for ( iAVA = 0; tmpRDN[ 0 ][ iAVA ]; iAVA++ ) {
- LDAPAVA *ava = tmpRDN[ 0 ][ iAVA ];
-
- assert( ava );
- assert( ava->la_attr.bv_val );
- assert( ava->la_value.bv_val );
-
- if ( types ) {
- charray_add_n( types, ava->la_attr.bv_val,
- ava->la_attr.bv_len );
- }
- charray_add_n( values, ava->la_value.bv_val,
- ava->la_value.bv_len );
- }
-
- ldap_rdnfree( tmpRDN );
-
- return LDAP_SUCCESS;
-}
-
/* rdnValidate:
*
LDAP_SLAPD_F (int) rdnValidate LDAP_P(( struct berval * rdn ));
+LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
+
+LDAP_SLAPD_F (void) build_new_dn LDAP_P((
+ struct berval * new_dn,
+ struct berval * parent_dn,
+ struct berval * newrdn ));
+
#define SLAP_DN_MIGRATION
#ifdef SLAP_DN_MIGRATION
/* These routines are deprecated!!! */
LDAP_SLAPD_F (char *) dn_validate LDAP_P(( char *dn ));
LDAP_SLAPD_F (char *) dn_normalize LDAP_P(( char *dn ));
LDAP_SLAPD_F (char *) dn_parent LDAP_P(( Backend *be, const char *dn ));
-LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
-LDAP_SLAPD_F (char *) rdn_attr_value LDAP_P(( const char * rdn ));
-LDAP_SLAPD_F (char *) rdn_attr_type LDAP_P(( const char * rdn ));
-LDAP_SLAPD_F (int) rdn_attrs LDAP_P(( const char * rdn,
- char ***ptypes, char ***pvals ));
-
-LDAP_SLAPD_F (void) build_new_dn LDAP_P(( struct berval * new_dn,
- struct berval * parent_dn,
- struct berval * newrdn ));
#endif
/*