]> git.sur5r.net Git - openldap/commitdiff
ITS#5631
authorQuanah Gibson-Mount <quanah@openldap.org>
Tue, 10 Feb 2009 17:58:02 +0000 (17:58 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 10 Feb 2009 17:58:02 +0000 (17:58 +0000)
CHANGES
servers/slapd/bconfig.c

diff --git a/CHANGES b/CHANGES
index 38f72cedac75e6ea053ff03835b7adaf36c430df..e00740852d6acb2fbdea12ac1c8343f5d2ce2171 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -26,6 +26,7 @@ OpenLDAP 2.4.14 Engineering
        Fixed slapd epoll handling (ITS#5886)
        Fixed slapd frontend/backend options handling (ITS#5857)
        Fixed slapd glue with MMR (ITS#5925)
+       Fixed slapd listener comparison (ITS#5631)
        Fixed slapd manageDSAit with glue entries (ITS#5921)
        Fixed slapd syncrepl rename handling (ITS#5809)
        Fixed slapd syncrepl MMR when adding new server (ITS#5850)
index e1bdb48a4f011e8725febfed054c1773f6bea494..a2c90144c7a7300ad5746a2fe41b911eacb30b73 100644 (file)
@@ -1783,20 +1783,28 @@ sortval_reject:
                                *sip = si;
 
                                if (( slapMode & SLAP_SERVER_MODE ) && c->argc > 2 ) {
+                                       Listener **l = slapd_get_listeners();
+                                       int i, isMe = 0;
+
+                                       /* Try a straight compare with Listener strings */
+                                       for ( i=0; l && l[i]; i++ ) {
+                                               if ( !strcasecmp( c->argv[2], l[i]->sl_url.bv_val )) {
+                                                       isMe = 1;
+                                                       break;
+                                               }
+                                       }
+
                                        /* If hostname is empty, or is localhost, or matches
                                         * our hostname, this serverID refers to this host.
                                         * Compare it against listeners and ports.
                                         */
-                                       if ( !lud->lud_host || !lud->lud_host[0] ||
+                                       if ( !isMe && ( !lud->lud_host || !lud->lud_host[0] ||
                                                !strncasecmp("localhost", lud->lud_host,
                                                        STRLENOF("localhost")) ||
-                                               !strcasecmp( global_host, lud->lud_host )) {
-                                               Listener **l = slapd_get_listeners();
-                                               int i;
+                                               !strcasecmp( global_host, lud->lud_host ))) {
 
                                                for ( i=0; l && l[i]; i++ ) {
                                                        LDAPURLDesc *lu2;
-                                                       int isMe = 0;
                                                        ldap_url_parse( l[i]->sl_url.bv_val, &lu2 );
                                                        do {
                                                                if ( strcasecmp( lud->lud_scheme,
@@ -1825,15 +1833,17 @@ sortval_reject:
                                                        } while(0);
                                                        ldap_free_urldesc( lu2 );
                                                        if ( isMe ) {
-                                                               slap_serverID = si->si_num;
-                                                               Debug( LDAP_DEBUG_CONFIG,
-                                                                       "%s: SID=%d (listener=%s)\n",
-                                                                       c->log, slap_serverID,
-                                                                       l[i]->sl_url.bv_val );
                                                                break;
                                                        }
                                                }
                                        }
+                                       if ( isMe ) {
+                                               slap_serverID = si->si_num;
+                                               Debug( LDAP_DEBUG_CONFIG,
+                                                       "%s: SID=%d (listener=%s)\n",
+                                                       c->log, slap_serverID,
+                                                       l[i]->sl_url.bv_val );
+                                       }
                                }
                                if ( c->argc > 2 )
                                        ldap_free_urldesc( lud );