return -1;
}
- ndn = ch_strdup( dn );
-
- if ( dn_normalize_case( ndn ) == NULL ) {
+ if ( dn_normalize( dn ) == NULL ) {
Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
free( dn );
- free( ndn );
return LDAP_INVALID_DN_SYNTAX;
}
+ ndn = ch_strdup( dn );
+ ldap_pvt_str2upper( ndn );
+
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
e->e_dn = dn;
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
int method,
char *mech,
struct berval *cred,
return( 1 );
}
- ret = bdb2i_back_bind_internal( be, conn, op, dn, method, mech, cred, edn );
+ ret = bdb2i_back_bind_internal( be, conn, op, ndn, method, mech, cred, edn );
(void) bdb2i_leave_backend_r( lock );
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
Ava *ava
)
{
}
- ret = bdb2i_back_compare_internal( be, conn, op, dn, ava );
+ ret = bdb2i_back_compare_internal( be, conn, op, ndn, ava );
(void) bdb2i_leave_backend_r( lock );
bdb2i_stop_timing( be->bd_info, time1, "CMP", conn, op );
BackendDB *be,
Connection *conn,
Operation *op,
- char *dn
+ char *dn,
+ char *ndn
)
{
DB_LOCK lock;
return( -1 );
}
- ret = bdb2i_back_delete_internal( be, conn, op, dn );
+ ret = bdb2i_back_delete_internal( be, conn, op, ndn );
(void) bdb2i_leave_backend_w( lock );
bdb2i_stop_timing( be->bd_info, time1, "DEL", conn, op );
extern int bdb2_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, int method, char* mech,
+ char *dn, char *ndn, int method, char* mech,
struct berval *cred, char** edn ));
extern int bdb2_back_unbind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op ));
extern int bdb2_back_search LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op,
- char *base, int scope, int deref, int sizelimit, int timelimit,
+ Connection *conn, Operation *op, char *base,
+ char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
extern int bdb2_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, Ava *ava ));
+ char *dn, char *ndn, Ava *ava ));
extern int bdb2_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, LDAPModList *ml ));
+ char *dn, char *ndn, LDAPModList *ml ));
extern int bdb2_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char*newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
extern int bdb2_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int bdb2_back_delete LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op, char *dn ));
+ Connection *conn, Operation *op, char *dn, char *ndn ));
extern int bdb2_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, int msgid ));
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
LDAPModList *modlist
)
{
break;
}
- if ( (e = bdb2i_dn2entry_w( be, dn, &matched )) == NULL ) {
+ if ( (e = bdb2i_dn2entry_w( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
goto done;
}
- ret = bdb2i_back_modify_internal( be, conn, op, dn, modlist, e );
+ ret = bdb2i_back_modify_internal( be, conn, op, ndn, modlist, e );
bdb2i_cache_return_entry_w( &li->li_cache, e );
done:
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
char *newrdn,
int deleteoldrdn,
char *newSuperior
}
- ret = bdb2i_back_modrdn_internal( be, conn, op, dn,
+ ret = bdb2i_back_modrdn_internal( be, conn, op, ndn,
newrdn, deleteoldrdn,
newSuperior );
Connection *conn,
Operation *op,
char *base,
+ char *nbase,
int scope,
int deref,
int slimit,
}
- ret = bdb2i_back_search_internal( be, conn, op, base, scope, deref,
+ ret = bdb2i_back_search_internal( be, conn, op, nbase, scope, deref,
slimit, tlimit, filter, filterstr, attrs, attrsonly );
(void) bdb2i_leave_backend_r( lock );
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
int method,
char *mech,
struct berval *cred,
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
Ava *ava
)
{
Backend *be,
Connection *conn,
Operation *op,
- char *dn
+ char *dn,
+ char *ndn
)
{
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
extern int ldap_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, int method, char* mech,
+ char *dn, char *ndn, int method, char* mech,
struct berval *cred, char** edn ));
extern int ldap_back_conn_destroy LDAP_P(( BackendDB *bd,
Connection *conn ));
extern int ldap_back_search LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op,
- char *base, int scope, int deref, int sizelimit, int timelimit,
+ Connection *conn, Operation *op, char *base, char *nbase,
+ int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
extern int ldap_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, Ava *ava ));
+ char *dn, char *ndn, Ava *ava ));
extern int ldap_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, LDAPModList *ml ));
+ char *dn, char *ndn, LDAPModList *ml ));
extern int ldap_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char*newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
extern int ldap_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int ldap_back_delete LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op, char *dn ));
+ Connection *conn, Operation *op, char *dn, char *ndn ));
extern int ldap_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, int msgid ));
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
LDAPModList *ml
)
{
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
char *newrdn,
int deleteoldrdn,
char *newSuperior
Connection *conn,
Operation *op,
char *base,
+ char *nbase,
int scope,
int deref,
int size,
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
int method,
char *mech,
struct berval *cred,
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_bind: dn: %s\n", dn, 0, 0);
*edn = NULL;
+ dn = ndn;
/* get entry with reader lock */
if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
Ava *ava
)
{
int manageDSAit = get_manageDSAit( op );
/* get entry with reader lock */
- if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
+ if ( (e = dn2entry_r( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
Backend *be,
Connection *conn,
Operation *op,
- char *dn
+ char *dn,
+ char *ndn
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_delete: %s\n", dn, 0, 0);
/* get entry with writer lock */
- if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) {
+ if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
extern int ldbm_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, int method, char* mech,
+ char *dn, char *ndn, int method, char* mech,
struct berval *cred, char** edn ));
extern int ldbm_back_unbind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op ));
extern int ldbm_back_search LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op,
- char *base, int scope, int deref, int sizelimit, int timelimit,
+ Connection *conn, Operation *op, char *base,
+ char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
extern int ldbm_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, Ava *ava ));
+ char *dn, char *ndn, Ava *ava ));
extern int ldbm_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, LDAPModList *ml ));
+ char *dn, char *ndn, LDAPModList *ml ));
extern int ldbm_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char* newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char* newrdn, int deleteoldrdn,
char *newSuperior ));
extern int ldbm_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int ldbm_back_delete LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op, char *dn ));
+ Connection *conn, Operation *op, char *dn, char *ndn ));
extern int ldbm_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, ber_int_t msgid ));
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
LDAPModList *modlist
)
{
Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
/* acquire and lock entry */
- if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) {
+ if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
struct berval **refs = NULL;
}
/* Modify the entry */
- if ( ldbm_modify_internal( be, conn, op, dn, modlist, e ) != 0 ) {
+ if ( ldbm_modify_internal( be, conn, op, ndn, modlist, e ) != 0 ) {
goto error_return;
}
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
char *newrdn,
int deleteoldrdn,
char *newSuperior
0, 0 );
/* get entry with writer lock */
- if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) {
+ if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
struct berval** refs = NULL;
Connection *conn,
Operation *op,
char *base,
+ char *nbase,
int scope,
int deref,
int slimit,
/* get entry with reader lock */
if ( deref & LDAP_DEREF_FINDING ) {
- e = deref_dn_r( be, base, &err, &matched, &text );
+ e = deref_dn_r( be, nbase, &err, &matched, &text );
} else {
- e = dn2entry_r( be, base, &matched );
+ e = dn2entry_r( be, nbase, &matched );
err = e != NULL ? LDAP_SUCCESS : LDAP_REFERRAL;
text = NULL;
}
extern int passwd_back_initialize LDAP_P(( BackendInfo *bi ));
extern int passwd_back_search LDAP_P(( BackendDB *be,
- Connection *c, Operation *o,
- char *base, int scope, int deref, int slimit, int tlimit,
+ Connection *c, Operation *o, char *base,
+ char *nbase, int scope, int deref, int slimit, int tlimit,
Filter *f, char *filterstr, char **attrs, int attrsonly));
extern int passwd_back_db_config LDAP_P((BackendDB *bd,
Connection *conn,
Operation *op,
char *base,
+ char *nbase,
int scope,
int deref,
int slimit,
#endif /* HAVE_SETPWFILE */
/* Handle a query for the base of this backend */
- if ( be_issuffix( be, base ) ) {
+ if ( be_issuffix( be, nbase ) ) {
struct berval val, *vals[2];
vals[0] = &val;
*/
if( !be_issuffix( be, parent ) ) {
int i;
- for( i=0; be->be_suffix[i] != NULL; i++ ) {
- if( dn_issuffix( base, be->be_suffix[i] ) ) {
+ for( i=0; be->be_nsuffix[i] != NULL; i++ ) {
+ if( dn_issuffix( nbase, be->be_nsuffix[i] ) ) {
matched = ch_strdup( be->be_suffix[i] );
break;
}
goto done;
}
- user = ldap_pvt_str2lower( user );
-
if ( (pw = getpwnam( user )) == NULL ) {
matched = parent;
parent = NULL;
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
int method,
char *mech,
struct berval *cred,
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
Ava *ava
)
{
Backend *be,
Connection *conn,
Operation *op,
- char *dn
+ char *dn,
+ char *ndn
)
{
int len;
extern int perl_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, int method, char* mech,
+ char *dn, char *ndn, int method, char* mech,
struct berval *cred, char** edn ));
extern int perl_back_unbind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op ));
extern int perl_back_search LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op,
- char *base, int scope, int deref, int sizelimit, int timelimit,
+ Connection *conn, Operation *op, char *base,
+ char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
extern int perl_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, Ava *ava ));
+ char *dn, char *ndn, Ava *ava ));
extern int perl_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, LDAPModList *ml ));
+ char *dn, char *ndn, LDAPModList *ml ));
extern int perl_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char*newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
extern int perl_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int perl_back_delete LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op, char *dn ));
+ Connection *conn, Operation *op, char *dn, char *ndn ));
LDAP_END_DECL
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
LDAPModList *modlist
)
{
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
char *newrdn,
int deleteoldrdn,
char *newSuperior
Connection *conn,
Operation *op,
char *base,
+ char *nbase,
int scope,
int deref,
int sizelimit,
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
int method,
char *mech,
struct berval *cred,
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
Ava *ava
)
{
Backend *be,
Connection *conn,
Operation *op,
- char *dn
+ char *dn,
+ char *ndn
)
{
struct shellinfo *si = (struct shellinfo *) be->be_private;
extern int shell_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, int method, char* mech,
+ char *dn, char *ndn, int method, char* mech,
struct berval *cred, char** edn ));
extern int shell_back_unbind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op ));
extern int shell_back_search LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op,
- char *base, int scope, int deref, int sizelimit, int timelimit,
+ Connection *conn, Operation *op, char *base,
+ char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
extern int shell_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, Ava *ava ));
+ char *dn, char *ndn, Ava *ava ));
extern int shell_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, LDAPModList *ml ));
+ char *dn, char *ndn, LDAPModList *ml ));
extern int shell_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *dn, char*newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
extern int shell_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int shell_back_delete LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op, char *dn ));
+ Connection *conn, Operation *op, char *dn, char *ndn ));
extern int shell_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, int msgid ));
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
LDAPModList *ml
)
{
Connection *conn,
Operation *op,
char *dn,
+ char *ndn,
char *newrdn,
int deleteoldrdn,
char *newSuperior
Connection *conn,
Operation *op,
char *base,
+ char *nbase,
int scope,
int deref,
int size,
extern int tcl_back_bind LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op,
- char *dn, int method, char *mech,
+ char *dn, char *ndn, int method, char *mech,
struct berval * cred, char **edn));
extern int tcl_back_unbind LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op));
extern int tcl_back_search LDAP_P ((BackendDB * bd,
- Connection * conn, Operation * op,
- char *base, int scope, int deref, int sizelimit, int timelimit,
+ Connection * conn, Operation * op, char *base,
+ char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter * filter, char *filterstr, char **attrs, int attrsonly));
extern int tcl_back_compare LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op,
- char *dn, Ava * ava));
+ char *dn, char *ndn, Ava * ava));
extern int tcl_back_modify LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op,
- char *dn, LDAPModList * ml));
+ char *dn, char *ndn, LDAPModList * ml));
extern int tcl_back_modrdn LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op,
- char *dn, char *newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char *newrdn, int deleteoldrdn,
char *newSuperior));
extern int tcl_back_add LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op, Entry * e));
extern int tcl_back_delete LDAP_P ((BackendDB * bd,
- Connection * conn, Operation * op, char *dn));
+ Connection * conn, Operation * op, char *dn, char *ndn));
extern int tcl_back_abandon LDAP_P ((BackendDB * bd,
Connection * conn, Operation * op, int msgid));
Connection * conn,
Operation * op,
char *dn,
+ char *ndn,
int method,
char *mech,
struct berval *cred,
Connection * conn,
Operation * op,
char *dn,
+ char *ndn,
Ava * ava
)
{
Backend * be,
Connection * conn,
Operation * op,
- char *dn
+ char *dn,
+ char *ndn
)
{
char *command, *suf_tcl, *results;
Connection * conn,
Operation * op,
char *dn,
+ char *ndn,
LDAPModList * modlist
)
{
Connection * conn,
Operation * op,
char *dn,
+ char *ndn,
char *newrdn,
int deleteoldrdn,
char *newSuperior
Connection * conn,
Operation * op,
char *base,
+ char *nbase,
int scope,
int deref,
int sizelimit,
goto cleanup;
}
- ndn = ch_strdup( dn );
-
- if ( dn_normalize_case( ndn ) == NULL ) {
+ if ( dn_normalize( dn ) == NULL ) {
Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto cleanup;
}
+ ndn = ch_strdup( dn );
+ ldap_pvt_str2upper( ndn );
+
op->o_protocol = version;
if( method != LDAP_AUTH_SASL ) {
/* deref suffix alias if appropriate */
ndn = suffix_alias( be, ndn );
- if ( (*be->be_bind)( be, conn, op, ndn, method, mech, &cred, &edn ) == 0 ) {
+ if ( (*be->be_bind)( be, conn, op, dn, ndn, method, mech, &cred, &edn ) == 0 ) {
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
conn->c_cdn = dn;
Operation *op
)
{
- char *ndn;
+ char *dn, *ndn;
Ava ava;
Backend *be;
int rc = LDAP_SUCCESS;
* }
*/
- if ( ber_scanf( op->o_ber, "{a{ao}}", &ndn, &ava.ava_type,
+ if ( ber_scanf( op->o_ber, "{a{ao}}", &dn, &ava.ava_type,
&ava.ava_value ) == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
send_ldap_disconnect( conn, op,
return -1;
}
- if( dn_normalize_case( ndn ) == NULL ) {
- Debug( LDAP_DEBUG_ANY, "do_compare: invalid dn (%s)\n", ndn, 0, 0 );
+ if( dn_normalize( dn ) == NULL ) {
+ Debug( LDAP_DEBUG_ANY, "do_compare: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
- free( ndn );
+ free( dn );
ava_free( &ava, 0 );
return rc;
}
if( ( rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
- free( ndn );
+ free( dn );
ava_free( &ava, 0 );
Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 );
return rc;
value_normalize( ava.ava_value.bv_val, attr_syntax( ava.ava_type ) );
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
- ndn, ava.ava_type, ava.ava_value.bv_val );
+ dn, ava.ava_type, ava.ava_value.bv_val );
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d CMP dn=\"%s\" attr=\"%s\"\n",
- op->o_connid, op->o_opid, ndn, ava.ava_type, 0 );
+ op->o_connid, op->o_opid, dn, ava.ava_type, 0 );
+
+ ndn = ch_strdup( dn );
+ ldap_pvt_str2upper( ndn );
/*
* We could be serving multiple database backends. Select the
* if we don't hold it.
*/
if ( (be = select_backend( ndn )) == NULL ) {
+ free( dn );
free( ndn );
ava_free( &ava, 0 );
ndn = suffix_alias( be, ndn );
if ( be->be_compare ) {
- (*be->be_compare)( be, conn, op, ndn, &ava );
+ (*be->be_compare)( be, conn, op, dn, ndn, &ava );
} else {
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "Function not implemented", NULL, NULL );
}
+ free( dn );
free( ndn );
ava_free( &ava, 0 );
Operation *op
)
{
- char *ndn;
+ char *dn, *ndn;
Backend *be;
int rc;
* DelRequest := DistinguishedName
*/
- if ( ber_scanf( op->o_ber, "a", &ndn ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "a", &dn ) == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding error" );
return -1;
}
- if( dn_normalize_case( ndn ) == NULL ) {
- Debug( LDAP_DEBUG_ANY, "do_delete: invalid dn (%s)\n", ndn, 0, 0 );
+ if( dn_normalize( dn ) == NULL ) {
+ Debug( LDAP_DEBUG_ANY, "do_delete: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
- free( ndn );
+ free( dn );
return rc;
}
if( ( rc = get_ctrls( conn, op, 1 ) ) != LDAP_SUCCESS ) {
- free( ndn );
+ free( dn );
Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
return rc;
}
- Debug( LDAP_DEBUG_ARGS, "do_delete: dn (%s)\n", ndn, 0, 0 );
- Debug( LDAP_DEBUG_STATS, "DEL dn=\"%s\"\n", ndn, 0, 0 );
+ Debug( LDAP_DEBUG_ARGS, "do_delete: dn (%s)\n", dn, 0, 0 );
+ Debug( LDAP_DEBUG_STATS, "DEL dn=\"%s\"\n", dn, 0, 0 );
+
+ ndn = ch_strdup( dn );
+ ldap_pvt_str2upper( ndn );
/*
* We could be serving multiple database backends. Select the
if ( (be = select_backend( ndn )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
+ free( dn );
free( ndn );
return rc;
}
if ( global_readonly || be->be_readonly ) {
Debug( LDAP_DEBUG_ANY, "do_delete: database is read-only\n",
0, 0, 0 );
+ free( dn );
free( ndn );
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
NULL, "database is read-only", NULL, NULL );
strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
#endif
{
- if ( (*be->be_delete)( be, conn, op, ndn ) == 0 ) {
+ if ( (*be->be_delete)( be, conn, op, dn, ndn ) == 0 ) {
#ifdef SLAPD_MULTIMASTER
if (be->be_update_ndn == NULL ||
strcmp( be->be_update_ndn, op->o_ndn ))
#endif
{
- replog( be, op, ndn, NULL );
+ replog( be, op, dn, NULL );
}
}
#ifndef SLAPD_MULTIMASTER
NULL, "Function not implemented", NULL, NULL );
}
+ free( dn );
free( ndn );
return rc;
}
Operation *op
)
{
- char *ndn;
+ char *dn, *ndn;
char *last;
ber_tag_t tag;
ber_len_t len;
* }
*/
- if ( ber_scanf( op->o_ber, "{a" /*}*/, &ndn ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "{a" /*}*/, &dn ) == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "do_modify: ber_scanf failed\n", 0, 0, 0 );
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding error" );
return -1;
}
- Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", ndn, 0, 0 );
+ Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn, 0, 0 );
- if( dn_normalize_case( ndn ) == NULL ) {
- Debug( LDAP_DEBUG_ANY, "do_modify: invalid dn (%s)\n", ndn, 0, 0 );
+ if( dn_normalize( dn ) == NULL ) {
+ Debug( LDAP_DEBUG_ANY, "do_modify: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
- free( ndn );
+ free( dn );
return rc;
}
{
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding modlist error" );
- free( ndn );
+ free( dn );
free( *modtail );
*modtail = NULL;
modlist_free( modlist );
(long) (*modtail)->ml_op, 0, 0 );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
NULL, "unrecognized modify operation", NULL, NULL );
- free( ndn );
+ free( dn );
modlist_free( modlist );
return LDAP_PROTOCOL_ERROR;
}
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
NULL, "unrecognized modify operation without values",
NULL, NULL );
- free( ndn );
+ free( dn );
modlist_free( modlist );
return LDAP_PROTOCOL_ERROR;
}
#endif
if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
- free( ndn );
+ free( dn );
modlist_free( modlist );
Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 );
return rc;
}
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d MOD dn=\"%s\"\n",
- op->o_connid, op->o_opid, ndn, 0, 0 );
+ op->o_connid, op->o_opid, dn, 0, 0 );
+
+ ndn = ch_strdup( ndn );
+ ldap_pvt_str2upper( ndn );
/*
* We could be serving multiple database backends. Select the
* if we don't hold it.
*/
if ( (be = select_backend( ndn )) == NULL ) {
+ free( dn );
free( ndn );
modlist_free( modlist );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
rc = add_modified_attrs( op, &modlist );
if( rc != LDAP_SUCCESS ) {
+ free( dn );
free( ndn );
modlist_free( modlist );
send_ldap_result( conn, op, rc,
}
}
- if ( (*be->be_modify)( be, conn, op, ndn, modlist ) == 0
+ if ( (*be->be_modify)( be, conn, op, dn, ndn, modlist ) == 0
#ifdef SLAPD_MULTIMASTER
&& ( be->be_update_ndn == NULL ||
strcmp( be->be_update_ndn, op->o_ndn ) != 0 )
#endif
) {
/* but we log only the ones not from a replicator user */
- replog( be, op, ndn, modlist );
+ replog( be, op, dn, modlist );
}
#ifndef SLAPD_MULTIMASTER
}
done:
+ free( dn );
free( ndn );
modlist_free( modlist );
return rc;
Operation *op
)
{
- char *ndn, *newrdn;
+ char *dn, *ndn, *newrdn;
ber_int_t deloldrdn;
Backend *be;
/* Vars for LDAP v3 newSuperior support */
* }
*/
- if ( ber_scanf( op->o_ber, "{aab", &ndn, &newrdn, &deloldrdn )
+ if ( ber_scanf( op->o_ber, "{aab", &dn, &newrdn, &deloldrdn )
== LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "ber_scanf failed\n", 0, 0, 0 );
send_ldap_disconnect( conn, op,
return -1;
}
- if( dn_normalize_case( ndn ) == NULL ) {
- Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid dn (%s)\n", ndn, 0, 0 );
+ if( dn_normalize( dn ) == NULL ) {
+ Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid dn (%s)\n", dn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
- free( ndn );
+ free( dn );
free( newrdn );
return rc;
}
Debug( LDAP_DEBUG_ANY, "do_modrdn: invalid rdn (%s)\n", newrdn, 0, 0 );
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid RDN", NULL, NULL );
- free( ndn );
+ free( dn );
free( newrdn );
return rc;
}
0, 0, 0 );
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "newSuperior requires LDAPv3" );
- free( ndn );
+ free( dn );
free( newrdn );
return -1;
}
0, 0, 0 );
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding error" );
- free( ndn );
+ free( dn );
free( newrdn );
return -1;
}
Debug( LDAP_DEBUG_ARGS,
"do_modrdn: dn (%s) newrdn (%s) newsuperior (%s)\n",
- ndn, newrdn,
+ dn, newrdn,
newSuperior != NULL ? newSuperior : "" );
if ( ber_scanf( op->o_ber, /*{*/ "}") == LBER_ERROR ) {
- free( ndn );
+ free( dn );
free( newrdn );
free( newSuperior );
free( nnewSuperior );
}
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d MODRDN dn=\"%s\"\n",
- op->o_connid, op->o_opid, ndn, 0, 0 );
+ op->o_connid, op->o_opid, dn, 0, 0 );
/*
* We could be serving multiple database backends. Select the
* if we don't hold it.
*/
+ ndn = ch_strdup( dn );
+ ldap_pvt_str2upper( ndn );
+
if ( (be = select_backend( ndn )) == NULL ) {
+ free( dn );
free( ndn );
free( newrdn );
free( newSuperior );
send_ldap_result( conn, op, rc,
NULL, NULL, NULL, NULL );
+ free( dn );
free( ndn );
free( newrdn );
free( newSuperior );
strcmp( be->be_update_ndn, op->o_ndn ) == 0 )
#endif
{
- if ( (*be->be_modrdn)( be, conn, op, ndn, newrdn,
+ if ( (*be->be_modrdn)( be, conn, op, dn, ndn, newrdn,
deloldrdn, newSuperior ) == 0
#ifdef SLAPD_MULTIMASTER
&& ( be->be_update_ndn == NULL ||
moddn.deloldrdn = deloldrdn;
moddn.newsup = newSuperior;
- replog( be, op, ndn, &moddn );
+ replog( be, op, dn, &moddn );
}
#ifndef SLAPD_MULTIMASTER
} else {
}
done:
+ free( dn );
free( ndn );
free( newrdn );
free( newSuperior );
int i, err;
ber_int_t scope, deref, attrsonly;
ber_int_t sizelimit, timelimit;
- char *base = NULL, *fstr = NULL;
+ char *base = NULL, *nbase = NULL, *fstr = NULL;
Filter *filter = NULL;
char **attrs = NULL;
Backend *be;
goto return_results;
}
- if( dn_normalize_case( base ) == NULL ) {
+ if( dn_normalize( base ) == NULL ) {
send_ldap_result( conn, op, LDAP_INVALID_DN_SYNTAX,
NULL, "invalid DN", NULL, NULL );
rc = -1;
"conn=%ld op=%d SRCH base=\"%s\" scope=%d filter=\"%s\"\n",
op->o_connid, op->o_opid, base, scope, fstr );
+ nbase = ch_strdup( base );
+ ldap_pvt_str2upper( nbase );
+
if ( scope == LDAP_SCOPE_BASE ) {
#if defined( SLAPD_MONITOR_DN )
- if ( strcmp( base, SLAPD_MONITOR_DN ) == 0 ) {
+ if ( strcmp( nbase, SLAPD_MONITOR_DN ) == 0 ) {
monitor_info( conn, op, attrs, attrsonly );
goto return_results;
}
#endif
#if defined( SLAPD_CONFIG_DN )
- if ( strcmp( base, SLAPD_CONFIG_DN ) == 0 ) {
+ if ( strcmp( nbase, SLAPD_CONFIG_DN ) == 0 ) {
config_info( conn, op, attrs, attrsonly );
goto return_results;
}
#endif
#if defined( SLAPD_SCHEMA_DN )
- if ( strcmp( base, SLAPD_SCHEMA_DN ) == 0 ) {
+ if ( strcmp( nbase, SLAPD_SCHEMA_DN ) == 0 ) {
schema_info( conn, op, attrs, attrsonly );
goto return_results;
}
#endif
- if ( strcmp( base, LDAP_ROOT_DSE ) == 0 ) {
+ if ( strcmp( nbase, LDAP_ROOT_DSE ) == 0 ) {
root_dse_info( conn, op, attrs, attrsonly );
goto return_results;
}
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- if ( (be = select_backend( base )) == NULL ) {
+ if ( (be = select_backend( nbase )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
}
/* deref the base if needed */
- base = suffix_alias( be, base );
+ nbase = suffix_alias( be, nbase );
/* actually do the search and send the result(s) */
if ( be->be_search ) {
- (*be->be_search)( be, conn, op, base, scope, deref, sizelimit,
+ (*be->be_search)( be, conn, op, base, nbase, scope, deref, sizelimit,
timelimit, filter, fstr, attrs, attrsonly );
} else {
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
return_results:;
if( base != NULL) free( base );
+ if( nbase != NULL) free( nbase );
if( fstr != NULL) free( fstr );
if( filter != NULL) filter_free( filter );
if ( attrs != NULL ) {
/* LDAP Operations Handling Routines */
int (*bi_op_bind) LDAP_P(( BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *dn, int method, char* mechanism,
+ char *dn, char *ndn, int method, char* mechanism,
struct berval *cred, char** edn ));
int (*bi_op_unbind) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o ));
int (*bi_op_search) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *base, int scope, int deref,
+ char *base, char *nbase, int scope, int deref,
int slimit, int tlimit,
Filter *f, char *filterstr, char **attrs,
int attrsonly));
int (*bi_op_compare)LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *dn, Ava *ava));
+ char *dn, char *ndn, Ava *ava));
int (*bi_op_modify) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *dn, LDAPModList *m));
+ char *dn, char *ndn, LDAPModList *m));
int (*bi_op_modrdn) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *dn, char *newrdn, int deleteoldrdn,
+ char *dn, char *ndn, char *newrdn, int deleteoldrdn,
char *newSuperior));
int (*bi_op_add) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
Entry *e));
int (*bi_op_delete) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
- char *dn));
+ char *dn, char *ndn));
int (*bi_op_abandon) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
ber_int_t msgid));