case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return( -1 );
}
#else /* !ENABLE_REWRITE */
#ifdef ENABLE_REWRITE
/*
* FIXME: dn-valued attrs should be rewritten
- * to allow their use in ACLs at the back-ldap
- * level.
+ * to allow their use in ACLs at back-ldap level.
*/
if ( strcmp( a->a_desc->ad_type->sat_syntax->ssyn_oid,
SLAPD_DN_SYNTAX ) == 0 ) {
- ldap_dnattr_rewrite( li->rwinfo, a->a_vals, conn );
+ /*
+ * FIXME: rewrite could fail; in this case
+ * the operation should give up, right?
+ */
+ (void)ldap_dnattr_rewrite( li->rwinfo, a->a_vals, conn );
}
#endif /* ENABLE_REWRITE */
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return( -1 );
}
#else /* !ENABLE_REWRITE */
if (err != LDAP_SUCCESS) {
err = ldap_back_map_result(err);
send_ldap_result( conn, op, err,
- NULL, "ldap_init failed", NULL, NULL );
+ NULL, "ldap_initialize() failed", NULL, NULL );
return( NULL );
}
/* Set LDAP version. This will always succeed: If the client
&lc->bound_dn.bv_val ) ) {
case REWRITE_REGEXEC_OK:
if ( lc->bound_dn.bv_val == NULL ) {
- ber_dupbv( &lc->bound_dn, &lc->conn->c_dn );
+ ber_dupbv( &lc->bound_dn,
+ &lc->conn->c_dn );
}
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDAP, DETAIL1,
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op,
LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
return( NULL );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op,
LDAP_OTHER,
- NULL, "Operations error",
+ NULL, "Rewrite error",
NULL, NULL );
return( NULL );
}
+
#else /* !ENABLE_REWRITE */
struct berval bv;
ldap_back_dn_massage( li, &lc->conn->c_dn, &bv, 0, 1 );
- if ( bv.bv_val == lc->conn->c_dn.bv_val )
+ if ( bv.bv_val == lc->conn->c_dn.bv_val ) {
ber_dupbv( &lc->bound_dn, &bv );
- else
+ } else {
lc->bound_dn = bv;
+ }
#endif /* !ENABLE_REWRITE */
+
} else {
lc->bound_dn.bv_val = NULL;
lc->bound_dn.bv_len = 0;
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return( -1 );
}
#else /* !ENABLE_REWRITE */
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return( -1 );
}
#else /* !ENABLE_REWRITE */
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return( -1 );
}
#else /* !ENABLE_REWRITE */
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error",
+ NULL, "Rewrite error",
NULL, NULL );
return( -1 );
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return( -1 );
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return( -1 );
}
#else /* !ENABLE_REWRITE */
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
rc = -1;
goto finish;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, "Operations error", NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
rc = -1;
goto finish;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
+ rc = -1;
+ goto finish;
+
case REWRITE_REGEXEC_ERR:
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, "Rewrite error", NULL, NULL );
rc = -1;
goto finish;
}
mapped_attrs[count] = NULL;
}
- if ((msgid = ldap_search(lc->ld, mbase.bv_val, scope, mapped_filter, mapped_attrs,
- attrsonly)) == -1)
- {
+ msgid = ldap_search(lc->ld, mbase.bv_val, scope, mapped_filter,
+ mapped_attrs, attrsonly);
+ if ( msgid == -1 ) {
fail:;
rc = ldap_back_op_result(lc, op);
goto finish;
break;
case REWRITE_REGEXEC_UNWILLING:
- send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
- NULL, NULL );
case REWRITE_REGEXEC_ERR:
- rc = -1;
- goto finish;
+ /* FIXME: no error, but no matched ... */
+ mmatch = NULL;
+ break;
}
}
if ( v2refs ) {
sres = LDAP_REFERRAL;
}
+
send_search_result( conn, op, sres,
mmatch, err, v2refs, NULL, count );
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return -1;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return -1;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
return -1;
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
rc = -1;
goto cleanup;
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op,
LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
return LDAP_UNWILLING_TO_PERFORM;
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return -1;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return -1;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return -1;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return -1;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed",
+ NULL, NULL );
return -1;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return -1;
}
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed", NULL, NULL );
return -1;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
return -1;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed",
+ NULL, NULL );
rc = -1;
goto finish;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "rewrite error", NULL, NULL );
rc = -1;
goto finish;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
+ NULL, "Operation not allowed",
+ NULL, NULL );
rc = -1;
goto finish;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
+ NULL, "Rewrite error", NULL, NULL );
rc = -1;
goto finish;
}
break;
case REWRITE_REGEXEC_UNWILLING:
- send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, NULL, NULL, NULL );
- rc = -1;
- goto finish;
case REWRITE_REGEXEC_ERR:
- send_ldap_result( conn, op, LDAP_OTHER,
- NULL, NULL, NULL, NULL );
- rc = -1;
- goto finish;
+ /* FIXME: no error, but no matched ... */
+ mmatch = NULL;
+ break;
}
}
}
break;
- case REWRITE_REGEXEC_ERR:
case REWRITE_REGEXEC_UNWILLING:
+ return LDAP_UNWILLING_TO_PERFORM;
+
+ case REWRITE_REGEXEC_ERR:
return LDAP_OTHER;
}