Commit 12e11c9b authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#9121 slapo-dynlist, -memberof: define memberOf if needed

Ignore if it's defined already. Make it no-user-mod.
parent 9d2f1530
Pipeline #711 passed with stage
in 28 minutes and 39 seconds
......@@ -37,6 +37,7 @@
#include "lutil.h"
static AttributeDescription *ad_dgIdentity, *ad_dgAuthz;
static AttributeDescription *ad_memberOf;
typedef struct dynlist_map_t {
AttributeDescription *dlm_member_ad;
......@@ -2626,8 +2627,29 @@ static
int
dynlist_initialize(void)
{
const char *text;
int rc = 0;
/* See if we need to define memberOf opattr */
rc = slap_str2ad( "memberOf", &ad_memberOf, &text );
if ( rc ) {
rc = register_at(
"( 1.2.840.113556.1.2.102 "
"NAME 'memberOf' "
"DESC 'Group that the entry belongs to' "
"SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' "
"EQUALITY distinguishedNameMatch " /* added */
"USAGE dSAOperation " /* added; questioned */
"NO-USER-MODIFICATION " /* added */
"X-ORIGIN 'iPlanet Delegated Administrator' )",
&ad_memberOf, 0 );
if ( rc ) {
Debug( LDAP_DEBUG_ANY,
"dynlist_initialize: register_at (memberOf) failed\n" );
return rc;
}
}
dynlist.on_bi.bi_type = "dynlist";
#ifdef TAKEOVER_DYNGROUP
......
......@@ -2155,7 +2155,7 @@ static struct {
"SYNTAX '1.3.6.1.4.1.1466.115.121.1.12' "
"EQUALITY distinguishedNameMatch " /* added */
"USAGE dSAOperation " /* added; questioned */
/* "NO-USER-MODIFICATION " */ /* add? */
"NO-USER-MODIFICATION " /* added */
"X-ORIGIN 'iPlanet Delegated Administrator' )",
&ad_memberOf },
{ NULL }
......@@ -2170,8 +2170,8 @@ memberof_initialize( void )
int code, i;
for ( i = 0; as[ i ].desc != NULL; i++ ) {
code = register_at( as[ i ].desc, as[ i ].adp, 0 );
if ( code ) {
code = register_at( as[ i ].desc, as[ i ].adp, 1 );
if ( code && code != SLAP_SCHERR_ATTR_DUP ) {
Debug( LDAP_DEBUG_ANY,
"memberof_initialize: register_at #%d failed\n",
i );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment