]> git.sur5r.net Git - openldap/commitdiff
address ITS#3831 (mostly code readability)
authorPierangelo Masarati <ando@openldap.org>
Mon, 4 Jul 2005 16:34:42 +0000 (16:34 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 4 Jul 2005 16:34:42 +0000 (16:34 +0000)
servers/slapd/syncrepl.c

index d84743c5c21a195a6c5c5230f006ab70e9da6d97..aab5c5fbd8a71ddb55e96b809467d52f0a84c875 100644 (file)
@@ -2240,21 +2240,22 @@ syncinfo_free( syncinfo_t *sie )
 /* NOTE: used & documented in slapd.conf(5) */
 #define IDSTR                  "rid"
 #define PROVIDERSTR            "provider"
-#define TYPESTR                        "type"
-#define INTERVALSTR            "interval"
-#define SEARCHBASESTR          "searchbase"
+#define SCHEMASTR              "schemachecking"
 #define FILTERSTR              "filter"
+#define SEARCHBASESTR          "searchbase"
 #define SCOPESTR               "scope"
-#define ATTRSSTR               "attrs"
 #define ATTRSONLYSTR           "attrsonly"
+#define ATTRSSTR               "attrs"
+#define TYPESTR                        "type"
+#define INTERVALSTR            "interval"
+#define RETRYSTR               "retry"
 #define SLIMITSTR              "sizelimit"
 #define TLIMITSTR              "timelimit"
-#define SCHEMASTR              "schemachecking"
 
 /* FIXME: undocumented */
 #define OLDAUTHCSTR            "bindprincipal"
 #define EXATTRSSTR             "exattrs"
-#define RETRYSTR               "retry"
+#define MANAGEDSAITSTR         "manageDSAit"
 
 /* FIXME: unused */
 #define LASTMODSTR             "lastmod"
@@ -2263,7 +2264,6 @@ syncinfo_free( syncinfo_t *sie )
 #define LMREQSTR               "req"
 #define SRVTABSTR              "srvtab"
 #define SUFFIXSTR              "suffix"
-#define MANAGEDSAITSTR         "manageDSAit"
 
 /* mandatory */
 #define GOT_ID                 0x0001
@@ -2278,11 +2278,13 @@ static struct {
 } scopes[] = {
        { BER_BVC("base"), LDAP_SCOPE_BASE },
        { BER_BVC("one"), LDAP_SCOPE_ONELEVEL },
+       { BER_BVC("onelevel"), LDAP_SCOPE_ONELEVEL },   /* OpenLDAP extension */
 #ifdef LDAP_SCOPE_SUBORDINATE
        { BER_BVC("children"), LDAP_SCOPE_SUBORDINATE },
-       { BER_BVC("subordinate"), 0 },
+       { BER_BVC("subordinate"), LDAP_SCOPE_SUBORDINATE },
 #endif
        { BER_BVC("sub"), LDAP_SCOPE_SUBTREE },
+       { BER_BVC("subtree"), LDAP_SCOPE_SUBTREE },     /* OpenLDAP extension */
        { BER_BVNULL, 0 }
 };
 
@@ -2357,9 +2359,7 @@ parse_syncrepl_line(
                        int j;
                        val = cargv[ i ] + STRLENOF( SCOPESTR "=" );
                        for ( j=0; !BER_BVISNULL(&scopes[j].key); j++ ) {
-                               if (!strncasecmp( val, scopes[j].key.bv_val,
-                                       scopes[j].key.bv_len )) {
-                                       while (!scopes[j].val) j--;
+                               if (!strcasecmp( val, scopes[j].key.bv_val )) {
                                        si->si_scope = scopes[j].val;
                                        break;
                                }