Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756.2.79
diff -u -p -r1.756.2.79 common.inc
--- includes/common.inc	4 Mar 2010 00:15:28 -0000	1.756.2.79
+++ includes/common.inc	25 May 2010 16:51:51 -0000
@@ -1847,7 +1847,7 @@ function drupal_get_css($css = NULL) {
 
   $preprocess_css = (variable_get('preprocess_css', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
   $directory = file_directory_path();
-  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $is_writable = is_dir($directory) && is_writable($directory);
 
   // A dummy query-string is added to filenames, to gain control over
   // browser-caching. The string changes on every update or full cache
@@ -1900,7 +1900,7 @@ function drupal_get_css($css = NULL) {
       // starting with "ad*".
       $filename = 'css_'. md5(serialize($types) . $query_string) .'.css';
       $preprocess_file = drupal_build_css_cache($types, $filename);
-      $output .= '<link type="text/css" rel="stylesheet" media="'. $media .'" href="'. base_path() . $preprocess_file .'" />'."\n";
+      $output .= '<style type="text/css" media="'. $media .'">@import "'. file_create_url($preprocess_file) .'";</style>'. "\n";
     }
   }
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.63.2.14
diff -u -p -r1.63.2.14 system.admin.inc
--- modules/system/system.admin.inc	1 Mar 2010 10:20:28 -0000	1.63.2.14
+++ modules/system/system.admin.inc	25 May 2010 16:52:00 -0000
@@ -1323,7 +1323,7 @@ function system_performance_settings() {
   );
 
   $directory = file_directory_path();
-  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $is_writable = is_dir($directory) && is_writable($directory);
   $form['bandwidth_optimizations']['preprocess_css'] = array(
     '#type' => 'radios',
     '#title' => t('Optimize CSS files'),
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.585.2.49
diff -u -p -r1.585.2.49 system.module
--- modules/system/system.module	4 Mar 2010 00:15:28 -0000	1.585.2.49
+++ modules/system/system.module	25 May 2010 16:52:01 -0000
@@ -1931,3 +1931,13 @@ function theme_system_powered_by($image_
   $image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'));
   return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE));
 }
+
+/**
+ * Implementation of hook_file_download().
+ * Make sure css aggregation folder is always accessible when using private file downloads.
+ */
+function system_file_download($file) {  
+  if (strpos($file, 'css/') === 0) {
+    return array('Content-type: text/css');
+  }
+}
\ No newline at end of file