]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
ITS#3353 consolidate slapd globals into a single struct
[openldap] / servers / slapd / backend.c
index 4c1d58a1be798124732d0e880fb9d9e766896890..14df526356644d3c7056e8974e9a88b8655fdaee 100644 (file)
@@ -344,9 +344,9 @@ int backend_startup(Backend *be)
                }
        }
 
-       ldap_pvt_thread_mutex_init( &syncrepl_rq.rq_mutex );
-       LDAP_STAILQ_INIT( &syncrepl_rq.task_list );
-       LDAP_STAILQ_INIT( &syncrepl_rq.run_list );
+       ldap_pvt_thread_mutex_init( &SLAPD_GLOBAL(runqueue).rq_mutex );
+       LDAP_STAILQ_INIT( &SLAPD_GLOBAL(runqueue).task_list );
+       LDAP_STAILQ_INIT( &SLAPD_GLOBAL(runqueue).run_list );
 
        /* open each backend database */
        for( i = 0; i < nBackendDB; i++ ) {
@@ -378,10 +378,10 @@ int backend_startup(Backend *be)
                        LDAP_STAILQ_FOREACH( si, &backendDB[i].be_syncinfo, si_next ) {
                                si->si_be = &backendDB[i];
                                init_syncrepl( si );
-                               ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
-                               ldap_pvt_runqueue_insert( &syncrepl_rq,
+                               ldap_pvt_thread_mutex_lock( &SLAPD_GLOBAL(runqueue).rq_mutex );
+                               ldap_pvt_runqueue_insert( &SLAPD_GLOBAL(runqueue),
                                                si->si_interval, do_syncrepl, (void *) si );
-                               ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
+                               ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(runqueue).rq_mutex );
                        }
                }
        }
@@ -782,7 +782,7 @@ be_isroot_pw( Operation *op )
        }
 
 #if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
-       ldap_pvt_thread_mutex_lock( &passwd_mutex );
+       ldap_pvt_thread_mutex_lock( &SLAPD_GLOBAL(passwd_mutex) );
 #ifdef SLAPD_SPASSWD
        lutil_passwd_sasl_conn = op->o_conn->c_sasl_authctx;
 #endif
@@ -794,7 +794,7 @@ be_isroot_pw( Operation *op )
 #ifdef SLAPD_SPASSWD
        lutil_passwd_sasl_conn = NULL;
 #endif
-       ldap_pvt_thread_mutex_unlock( &passwd_mutex );
+       ldap_pvt_thread_mutex_unlock( &SLAPD_GLOBAL(passwd_mutex) );
 #endif
 
        return result == 0;
@@ -1109,7 +1109,7 @@ backend_check_restrictions(
                                return rs->sr_err;
                        }
 
-                       if( !( global_allows & SLAP_ALLOW_UPDATE_ANON ) &&
+                       if( !( SLAPD_GLOBAL(allows) & SLAP_ALLOW_UPDATE_ANON ) &&
                                op->o_ndn.bv_len == 0 )
                        {
                                rs->sr_text = "modifications require authentication";