Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.34
diff -u -p -r1.34 install.php
--- install.php	10 Jan 2007 10:15:07 -0000	1.34
+++ install.php	16 Jan 2007 19:39:45 -0000
@@ -17,6 +17,10 @@ require_once './includes/install.inc';
 function install_main() {
   global $profile, $install_locale;
   require_once './includes/bootstrap.inc';
+  $settings_file = './'. conf_path() .'/settings.php';
+  // If the settings file exists but is unreadable, try to change the
+  // permissions so that it is readable (i.e. the web server is the owner).
+  drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE);
   drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
   require_once './modules/system/system.install';
   require_once './includes/file.inc';
@@ -87,7 +91,6 @@ function install_main() {
   drupal_install_profile($profile, $modules);
 
   // Warn about settings.php permissions risk
-  $settings_file = './'. conf_path() .'/settings.php';
   if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE)) {
     drupal_set_message(st('All necessary changes to %file have been made, so you should now remove write permissions to this file. Failure to remove write permissions to this file is a security risk.', array('%file' => $settings_file)), 'error');
   }
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.145
diff -u -p -r1.145 bootstrap.inc
--- includes/bootstrap.inc	15 Jan 2007 11:52:02 -0000	1.145
+++ includes/bootstrap.inc	16 Jan 2007 19:39:45 -0000
@@ -235,7 +235,16 @@ function drupal_unset_globals() {
 function conf_init() {
   global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf, $installed_profile;
   $conf = array();
-  include_once './'. conf_path() .'/settings.php';
+  $include_result = include_once './'. conf_path() .'/settings.php';
+  if (!$include_result) {
+    // settings.php was unreadable or does not exist.
+    $settings = './'. conf_path() .'/settings.php';
+    drupal_maintenance_theme();
+    drupal_set_title('Cannot read settings');
+    print theme('maintenance_page', '<p>The configuration file '. theme('placeholder', $settings) . (file_exists($settings)? ' is unreadable. Please add read permissions to the file using chmod or another file utility.' : ' does not exist. Please check that all files were downloaded and copied correctly.') .'</p>
+<p>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>');
+    exit;
+  }
 
   if (isset($base_url)) {
     // Parse fixed base URL from settings.php.
