From: Pierangelo Masarati Date: Fri, 26 Nov 2004 00:34:48 +0000 (+0000) Subject: fix dynacl compile X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~221 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e891dbcdc47ea22d00050d49dbcef99224a66e00;p=openldap fix dynacl compile --- diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 2be75b5128..d7cb98d2ae 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -2845,28 +2845,11 @@ static slap_dynacl_t dynacl_aci = { NULL }; -#endif /* SLAPD_ACI_ENABLED */ +#endif /* SLAP_DYNACL */ -int -aci_init( void ) -{ - slap_dynacl_t *known_dynacl[] = { -#ifdef SLAPD_ACI_ENABLED - &dynacl_aci, -#endif /* SLAPD_ACI_ENABLED */ - NULL - }; - int i, rc; +#endif /* SLAPD_ACI_ENABLED */ - for ( i = 0; known_dynacl[ i ]; i++ ) { - rc = slap_dynacl_register( known_dynacl[ i ] ); - if ( rc ) { - return rc; - } - } - - return 0; -} +#ifdef SLAP_DYNACL /* * dynamic ACL infrastructure @@ -2926,23 +2909,26 @@ slap_dynacl_get( const char *name ) int acl_init( void ) { + int i, rc; #ifdef SLAP_DYNACL - int rc; - - da_list = NULL; - + slap_dynacl_t *known_dynacl[] = { #ifdef SLAPD_ACI_ENABLED - rc = aci_init(); - if ( rc ) { - return rc; + &dynacl_aci, +#endif /* SLAPD_ACI_ENABLED */ + NULL + }; + + for ( i = 0; known_dynacl[ i ]; i++ ) { + rc = slap_dynacl_register( known_dynacl[ i ] ); + if ( rc ) { + return rc; + } } -#endif /* SLAPD_ACI_ENABLED */ #endif /* SLAP_DYNACL */ return 0; } - static int string_expand( struct berval *bv, diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 06698a1f6f..58980377b7 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -46,6 +46,12 @@ LDAP_SLAPD_F (int) acl_check_modlist LDAP_P(( LDAP_SLAPD_F (void) acl_append( AccessControl **l, AccessControl *a ); +#ifdef SLAP_DYNACL +LDAP_SLAPD_F (int) slap_dynacl_register LDAP_P(( slap_dynacl_t *da )); +LDAP_SLAPD_F (slap_dynacl_t *) slap_dynacl_get LDAP_P(( const char *name )); +#endif /* SLAP_DYNACL */ +LDAP_SLAPD_F (int) acl_init LDAP_P(( void )); + /* * aclparse.c */ @@ -62,6 +68,7 @@ LDAP_SLAPD_F (slap_mask_t) str2accessmask LDAP_P(( const char *str )); LDAP_SLAPD_F (void) acl_destroy LDAP_P(( AccessControl*, AccessControl* )); LDAP_SLAPD_F (void) acl_free LDAP_P(( AccessControl *a )); + /* * ad.c */ diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index c5ec701d55..eb8ad85764 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1157,7 +1157,7 @@ typedef struct slap_authz_info { } AuthorizationInformation; -#if 0 /* LDAP_DEVEL */ +#ifdef LDAP_DEVEL #define SLAP_DYNACL #endif /* LDAP_DEVEL */