@@ -123,30 +123,7 @@ msc_engine *modsecurity_create(apr_pool_t *mp, int processing_mode) {
123123}
124124
125125int acquire_global_lock (apr_global_mutex_t * * lock , apr_pool_t * mp ) {
126- apr_status_t rc ;
127- apr_file_t * lock_name ;
128- const char * temp_dir ;
129- const char * filename = NULL ;
130-
131- // get platform temp dir
132- rc = apr_temp_dir_get (& temp_dir , mp );
133- if (rc != APR_SUCCESS ) {
134- ap_log_perror (APLOG_MARK , APLOG_ERR , 0 , mp , "ModSecurity: Could not get temp dir" );
135- return -1 ;
136- }
137-
138- // use temp path template for lock files
139- char * path = apr_pstrcat (mp , temp_dir , GLOBAL_LOCK_TEMPLATE , NULL );
140-
141- rc = apr_file_mktemp (& lock_name , path , 0 , mp );
142- if (rc != APR_SUCCESS ) {
143- ap_log_perror (APLOG_MARK , APLOG_ERR , 0 , mp , " ModSecurity: Could not create temporary file for global lock" );
144- return -1 ;
145- }
146- // below func always return APR_SUCCESS
147- apr_file_name_get (& filename , lock_name );
148-
149- rc = apr_global_mutex_create (lock , filename , APR_LOCK_DEFAULT , mp );
126+ apr_status_t rc = apr_global_mutex_create (lock , NULL , APR_LOCK_DEFAULT , mp );
150127 if (rc != APR_SUCCESS ) {
151128 ap_log_perror (APLOG_MARK , APLOG_ERR , 0 , mp , " ModSecurity: Could not create global mutex" );
152129 return -1 ;
0 commit comments