char **argv
)
{
+ slap_overinst *on = (slap_overinst *) be->bd_info;
+ struct ldaprwmap *rwmap =
+ (struct ldaprwmap *)on->on_bi.bi_private;
+
int rc = 0;
char *argv0 = NULL;
} else if ( strcasecmp( argv[0], "suffixmassage" ) == 0 ) {
rc = rwm_suffixmassage_config( be, fname, lineno, argc, argv );
+ } else if ( strcasecmp( argv[0], "t-f-support" ) == 0 ) {
+ if ( argc != 2 ) {
+ fprintf( stderr,
+ "%s: line %d: \"t-f-support {no|yes|discover}\" needs 1 argument.\n",
+ fname, lineno );
+ return( 1 );
+ }
+
+ if ( strcasecmp( argv[ 1 ], "no" ) == 0 ) {
+ rwmap->rwm_flags &= ~(RWM_F_SUPPORT_T_F|RWM_F_SUPPORT_T_F_DISCOVER);
+
+ } else if ( strcasecmp( argv[ 1 ], "yes" ) == 0 ) {
+ rwmap->rwm_flags |= RWM_F_SUPPORT_T_F;
+
+#if 0
+ /* TODO: not implemented yet */
+ } else if ( strcasecmp( argv[ 1 ], "discover" ) == 0 ) {
+ rwmap->rwm_flags |= RWM_F_SUPPORT_T_F_DISCOVER;
+#endif
+
+ } else {
+ fprintf( stderr,
+ "%s: line %d: unknown value \"%s\" for \"t-f-support {no|yes|discover}\".\n",
+ fname, lineno, argv[ 1 ] );
+ return 1;
+ }
+
} else {
rc = SLAP_CONF_UNKNOWN;
}
*/
struct ldapmap rwm_oc;
struct ldapmap rwm_at;
+
+#define RWM_F_NONE 0x0000U
+#define RWM_F_SUPPORT_T_F 0x4000U
+#define RWM_F_SUPPORT_T_F_DISCOVER 0x8000U
+ unsigned rwm_flags;
};
/* Whatever context ldap_back_dn_massage needs... */
int remap );
int rwm_mapping ( struct ldapmap *map, struct berval *s,
struct ldapmapping **m, int remap );
-#define RWM_MAP 0
+#define RWM_MAP 0
#define RWM_REMAP 1
char *
rwm_map_filter(
vtmp,
tmp;
static struct berval
+#if 0
ber_bvfalse = BER_BVC( "(?=false)" ),
+#endif
+ /* better than nothing... */
+ ber_bvfalse = BER_BVC( "(!(objectClass=*))" ),
+ ber_bvtf_false = BER_BVC( "(|)" ),
+#if 0
ber_bvtrue = BER_BVC( "(?=true)" ),
+#endif
+ /* better than nothing... */
+ ber_bvtrue = BER_BVC( "(objectClass=*)" ),
+ ber_bvtf_true = BER_BVC( "(&)" ),
ber_bvundefined = BER_BVC( "(?=undefined)" ),
ber_bverror = BER_BVC( "(?=error)" ),
ber_bvunknown = BER_BVC( "(?=unknown)" ),
case SLAPD_FILTER_COMPUTED:
switch ( f->f_result ) {
case LDAP_COMPARE_FALSE:
- tmp = ber_bvfalse;
+ if ( dc->rwmap->rwm_flags & RWM_F_SUPPORT_T_F ) {
+ tmp = ber_bvtf_false;
+ } else {
+ tmp = ber_bvfalse;
+ }
break;
case LDAP_COMPARE_TRUE:
- tmp = ber_bvtrue;
+ if ( dc->rwmap->rwm_flags & RWM_F_SUPPORT_T_F ) {
+ tmp = ber_bvtf_true;
+ } else {
+ tmp = ber_bvtrue;
+ }
break;
case SLAPD_COMPARE_UNDEFINED: