From b4894ccd81a8ab161ec9db372312205dd6c49556 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 29 Jun 2008 21:50:05 +0000 Subject: [PATCH] don't lookup dg* attrs more than needed (ITS#5583) --- servers/slapd/overlays/dynlist.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index ba9a9d2ac5..2cbf53e79f 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -1557,22 +1557,26 @@ dynlist_db_open( } } - rc = slap_str2ad( "dgIdentity", &ad_dgIdentity, &text ); - if ( rc != LDAP_SUCCESS ) { - snprintf( cr->msg, sizeof( cr->msg), - "unable to fetch attributeDescription \"dgIdentity\": %d (%s)", - rc, text ); - Debug( LDAP_DEBUG_ANY, "dynlist_db_open: %s\n", cr->msg, 0, 0 ); - /* Just a warning */ + if ( ad_dgIdentity == NULL ) { + rc = slap_str2ad( "dgIdentity", &ad_dgIdentity, &text ); + if ( rc != LDAP_SUCCESS ) { + snprintf( cr->msg, sizeof( cr->msg), + "unable to fetch attributeDescription \"dgIdentity\": %d (%s)", + rc, text ); + Debug( LDAP_DEBUG_ANY, "dynlist_db_open: %s\n", cr->msg, 0, 0 ); + /* Just a warning */ + } } - rc = slap_str2ad( "dgAuthz", &ad_dgAuthz, &text ); - if ( rc != LDAP_SUCCESS ) { - snprintf( cr->msg, sizeof( cr->msg), - "unable to fetch attributeDescription \"dgAuthz\": %d (%s)", - rc, text ); - Debug( LDAP_DEBUG_ANY, "dynlist_db_open: %s\n", cr->msg, 0, 0 ); - /* Just a warning */ + if ( ad_dgAuthz == NULL ) { + rc = slap_str2ad( "dgAuthz", &ad_dgAuthz, &text ); + if ( rc != LDAP_SUCCESS ) { + snprintf( cr->msg, sizeof( cr->msg), + "unable to fetch attributeDescription \"dgAuthz\": %d (%s)", + rc, text ); + Debug( LDAP_DEBUG_ANY, "dynlist_db_open: %s\n", cr->msg, 0, 0 ); + /* Just a warning */ + } } return 0; -- 2.39.5