diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 71895b2..a7e6035 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -665,7 +665,8 @@ function drupal_generate_test_ua($prefix) { if (!isset($key) || $last_prefix != $prefix) { $last_prefix = $prefix; $test_db = new TestDatabase($prefix); - $key_file = DRUPAL_ROOT . '/' . $test_db->getTestSitePath() . '/.htkey'; + $key_file_directory = DRUPAL_ROOT . '/' . $test_db->getTestSitePath(); + $key_file = $key_file_directory . '/.htkey'; // When issuing an outbound HTTP client request from within an inbound test // request, then the outbound request has to use the same User-Agent header // as the inbound request. A newly generated private key for the same test @@ -681,6 +682,7 @@ function drupal_generate_test_ua($prefix) { else { // Generate and save a new hash salt for a test run. // Consumed by drupal_valid_test_ua() before settings.php is loaded. + chmod($key_file_directory, 0775); $private_key = Crypt::randomBytesBase64(55); file_put_contents($key_file, $private_key); }