From 3ee954de818f9558ef0175104ec6c96deaca0b63 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 20 Oct 2005 23:20:10 +0000 Subject: [PATCH] fix custom group objectclass/member attribute parsing; let ACI code be built as dynamic module --- servers/slapd/aci.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/servers/slapd/aci.c b/servers/slapd/aci.c index 6b44e80244..a77a9fb3ce 100644 --- a/servers/slapd/aci.c +++ b/servers/slapd/aci.c @@ -1320,11 +1320,15 @@ OpenLDAPaciValidate( atbv = BER_BVNULL; ocbv.bv_val = strchr( type.bv_val, '/' ); - if ( ocbv.bv_val != NULL ) { + if ( ocbv.bv_val != NULL + && ( ocbv.bv_val - type.bv_val ) < type.bv_len ) + { ocbv.bv_val++; atbv.bv_val = strchr( ocbv.bv_val, '/' ); - if ( atbv.bv_val != NULL ) { + if ( atbv.bv_val != NULL + && ( atbv.bv_val - ocbv.bv_val ) < ocbv.bv_len ) + { AttributeDescription *ad = NULL; const char *text = NULL; int rc; @@ -1471,7 +1475,9 @@ OpenLDAPaciPrettyNormal( atbv = BER_BVNULL; ocbv.bv_val = strchr( type.bv_val, '/' ); - if ( ocbv.bv_val != NULL ) { + if ( ocbv.bv_val != NULL + && ( ocbv.bv_val - type.bv_val ) < type.bv_len ) + { ObjectClass *oc = NULL; AttributeDescription *ad = NULL; const char *text = NULL; @@ -1483,7 +1489,9 @@ OpenLDAPaciPrettyNormal( ocbv.bv_val++; atbv.bv_val = strchr( ocbv.bv_val, '/' ); - if ( atbv.bv_val != NULL ) { + if ( atbv.bv_val != NULL + && ( atbv.bv_val - ocbv.bv_val ) < ocbv.bv_len ) + { atbv.bv_val++; atbv.bv_len = type.bv_len - ( atbv.bv_val - type.bv_val ); @@ -1616,5 +1624,17 @@ OpenLDAPaciNormalize( return OpenLDAPaciPrettyNormal( val, out, ctx, 1 ); } +#if SLAPD_ACI_ENABLED == SLAPD_MOD_DYNAMIC +/* + * FIXME: need config and Makefile.am code to ease building + * as dynamic module + */ +int +init_module( int argc, char *argv[] ) +{ + return slap_dynacl_register(); +} +#endif /* SLAPD_ACI_ENABLED == SLAPD_MOD_DYNAMIC */ + #endif /* SLAPD_ACI_ENABLED */ -- 2.39.5