int last = -1;
Attribute *a;
- if ( op->ors_attrs != NULL &&
+ if ( ( rwmap->rwm_flags & RWM_F_DROP_UNREQUESTED_ATTRS ) &&
+ op->ors_attrs != NULL &&
!SLAP_USERATTRS( rs->sr_attr_flags ) &&
!ad_inlist( (*ap)->a_desc, op->ors_attrs ) )
{
RWM_CF_MAP,
RWM_CF_T_F_SUPPORT,
RWM_CF_NORMALIZE_MAPPED,
+ RWM_CF_DROP_UNREQUESTED,
RWM_CF_LAST
};
"SINGLE-VALUE )",
NULL, NULL },
+ { "rwm-drop-unrequested-attrs", "true|false",
+ 2, 2, 0, ARG_MAGIC|ARG_ON_OFF|RWM_CF_DROP_UNREQUESTED, rwm_cf_gen,
+ "( OLcfgOvAt:16.5 NAME 'olcRwmDropUnrequested' "
+ "DESC 'Drop unrequested attributes' "
+ "SYNTAX OMsBoolean "
+ "SINGLE-VALUE )",
+ NULL, NULL },
+
{ NULL, NULL, 0, 0, 0, ARG_IGNORED }
};
c->value_int = ( rwmap->rwm_flags & RWM_F_NORMALIZE_MAPPED_ATTRS );
break;
+ case RWM_CF_DROP_UNREQUESTED:
+ c->value_int = ( rwmap->rwm_flags & RWM_F_DROP_UNREQUESTED_ATTRS );
+ break;
+
default:
assert( 0 );
rc = 1;
rwmap->rwm_flags &= ~RWM_F_NORMALIZE_MAPPED_ATTRS;
break;
+ case RWM_CF_DROP_UNREQUESTED:
+ rwmap->rwm_flags &= ~RWM_F_DROP_UNREQUESTED_ATTRS;
+ break;
+
default:
return 1;
}
}
break;
+ case RWM_CF_DROP_UNREQUESTED:
+ if ( c->value_int ) {
+ rwmap->rwm_flags |= RWM_F_DROP_UNREQUESTED_ATTRS;
+ } else {
+ rwmap->rwm_flags &= ~RWM_F_DROP_UNREQUESTED_ATTRS;
+ }
+ break;
+
default:
assert( 0 );
return 1;
rwmap = (struct ldaprwmap *)ch_calloc( 1, sizeof( struct ldaprwmap ) );
+ /* default */
+ rwmap->rwm_flags = RWM_F_DROP_UNREQUESTED_ATTRS;
+
rc = rwm_info_init( &rwmap->rwm_rw );
-error_return:;
on->on_bi.bi_private = (void *)rwmap;
if ( rc ) {
#define RWM_F_NONE (0x0000U)
#define RWM_F_NORMALIZE_MAPPED_ATTRS (0x0001U)
+#define RWM_F_DROP_UNREQUESTED_ATTRS (0x0002U)
#define RWM_F_SUPPORT_T_F (0x4000U)
#define RWM_F_SUPPORT_T_F_DISCOVER (0x8000U)
#define RWM_F_SUPPORT_T_F_MASK (RWM_F_SUPPORT_T_F)