Index: INSTALL.txt
===================================================================
RCS file: /cvs/drupal/drupal/INSTALL.txt,v
retrieving revision 1.81
diff -u -p -r1.81 INSTALL.txt
--- INSTALL.txt	30 Jul 2010 01:59:14 -0000	1.81
+++ INSTALL.txt	7 Sep 2010 07:32:01 -0000
@@ -79,13 +79,15 @@ INSTALLATION
    http://drupal.org/project/translations and download the package. Extract
    the contents to the same directory where you extracted Drupal into.
 
-2. CREATE THE CONFIGURATION FILE AND GRANT WRITE PERMISSIONS
+2. IF NECESSARY, CREATE THE CONFIGURATION FILE AND GRANT WRITE PERMISSIONS
 
    Drupal comes with a default.settings.php file in the sites/default
    directory. The installer uses this file as a template to create your
    settings file using the details you provide through the install process.
    To avoid problems when upgrading, Drupal is not packaged with an actual
-   settings file. You must create a file named settings.php. You may do so
+   settings file. During installation, Drupal will try to create this settings
+   file automatically. If this fails (which it can due to different server
+   setups), you must create a file named settings.php yourself. You may do so
    by making a copy of default.settings.php (or create an empty file with
    this name in the same directory). For example, (from the installation
    directory) make a copy of the default.settings.php file with the command:
Index: includes/install.core.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.core.inc,v
retrieving revision 1.28
diff -u -p -r1.28 install.core.inc
--- includes/install.core.inc	1 Sep 2010 01:24:05 -0000	1.28
+++ includes/install.core.inc	7 Sep 2010 07:32:02 -0000
@@ -1568,7 +1568,7 @@ function install_check_requirements($ins
     $exists = FALSE;
     // Verify that the directory exists.
     if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) {
-      // Check to make sure a settings.php already exists.
+      // Check if a settings.php file already exists.
       $file = $settings_file;
       if (drupal_verify_install_file($settings_file, FILE_EXIST)) {
         // If it does, make sure it is writable.
@@ -1587,6 +1587,29 @@ function install_check_requirements($ins
         'description' => st('The @drupal installer requires that the %default-file file not be modified in any way from the original download.', array('@drupal' => drupal_install_profile_distribution_name(), '%default-file' => $default_settings_file)),
       );
     }
+    // If default.settings.php is readable and settings.php does not exist yet,
+    // we can try to copy it.
+    elseif (!$exists && drupal_verify_install_file($conf_path, FILE_EXIST|FILE_WRITABLE, 'dir') && @copy($default_settings_file, $settings_file)) {
+      // If settings.php was successfully created and has the same owner as the
+      // original default.settings.php, we keep this file and verify that it is
+      // writable; otherwise, we delete it and force the administrator to log
+      // on to the server and create it manually. It is unsafe to keep a
+      // webserver-owned PHP file on a system where the webserver is running as
+      // its own user (distinct from the user who owns the Drupal files), since
+      // this would cause usability issues (site owners who do not have root
+      // access to the file system would not be able to edit their settings
+      // file later on) as well as security issues (a malicious webserver
+      // process could append arbitrary code to the settings file, even if the
+      // rest of the Drupal installation directory is protected against such
+      // threats).
+      if (fileowner($default_settings_file) == fileowner($settings_file)) {
+        $writable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITABLE);
+        $exists = TRUE;
+      }
+      else {
+        drupal_unlink($settings_file);
+      }
+    }
 
     // If settings.php does not exist, throw an error.
     if (!$exists) {
