@@ -122,7 +122,7 @@ msc_engine *modsecurity_create(apr_pool_t *mp, int processing_mode) {
122
122
return msce ;
123
123
}
124
124
125
- int acquire_global_lock (apr_global_mutex_t * lock , apr_pool_t * mp ) {
125
+ int acquire_global_lock (apr_global_mutex_t * * lock , apr_pool_t * mp ) {
126
126
apr_status_t rc ;
127
127
apr_file_t * lock_name ;
128
128
const char * temp_dir ;
@@ -146,19 +146,20 @@ int acquire_global_lock(apr_global_mutex_t *lock, apr_pool_t *mp) {
146
146
// below func always return APR_SUCCESS
147
147
apr_file_name_get (& filename , lock_name );
148
148
149
- rc = apr_global_mutex_create (& lock , filename , APR_LOCK_DEFAULT , mp );
149
+ rc = apr_global_mutex_create (lock , filename , APR_LOCK_DEFAULT , mp );
150
150
if (rc != APR_SUCCESS ) {
151
151
ap_log_perror (APLOG_MARK , APLOG_ERR , 0 , NULL , " ModSecurity: Could not create global mutex" );
152
152
return -1 ;
153
153
}
154
154
#if !defined(MSC_TEST )
155
155
#ifdef __SET_MUTEX_PERMS
156
156
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2
157
- rc = ap_unixd_set_global_mutex_perms (lock );
157
+ rc = ap_unixd_set_global_mutex_perms (* lock );
158
158
#else
159
- rc = unixd_set_global_mutex_perms (lock );
159
+ rc = unixd_set_global_mutex_perms (* lock );
160
160
#endif
161
161
if (rc != APR_SUCCESS ) {
162
+ ap_log_perror (APLOG_MARK , APLOG_ERR , 0 , NULL , " ModSecurity: Could not set permissions on global mutex" );
162
163
return -1 ;
163
164
}
164
165
#endif /* SET_MUTEX_PERMS */
@@ -189,21 +190,15 @@ int modsecurity_init(msc_engine *msce, apr_pool_t *mp) {
189
190
curl_global_init (CURL_GLOBAL_ALL );
190
191
#endif
191
192
/* Serial audit log mutex */
192
- rc = acquire_global_lock (msce -> auditlog_lock , mp );
193
- if (rc != APR_SUCCESS ) {
194
- return -1 ;
195
- }
193
+ rc = acquire_global_lock (& msce -> auditlog_lock , mp );
194
+ if (rc != APR_SUCCESS ) return -1 ;
196
195
197
- rc = acquire_global_lock (msce -> geo_lock , mp );
198
- if (rc != APR_SUCCESS ) {
199
- return -1 ;
200
- }
196
+ rc = acquire_global_lock (& msce -> geo_lock , mp );
197
+ if (rc != APR_SUCCESS ) return -1 ;
201
198
202
199
#ifdef GLOBAL_COLLECTION_LOCK
203
200
rc = acquire_global_lock (& msce -> dbm_lock , mp );
204
- if (rc != APR_SUCCESS ) {
205
- return -1 ;
206
- }
201
+ if (rc != APR_SUCCESS ) return -1 ;
207
202
#endif /* GLOBAL_COLLECTION_LOCK */
208
203
209
204
return 1 ;
0 commit comments