? .DS_Store ? .cache ? .cvsignore ? .git ? .project ? .settings ? file_203204_5.patch ? file_203204_5.patch.1 ? locale-registry-283201-1.patch ? test ? modules/.DS_Store ? modules/simpletest/.DS_Store ? sites/all/modules ? sites/default/files ? sites/default/settings.php ? sites/default/test Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.135 diff -u -p -r1.135 file.inc --- includes/file.inc 20 Sep 2008 03:49:23 -0000 1.135 +++ includes/file.inc 2 Oct 2008 06:39:03 -0000 @@ -646,6 +646,11 @@ function file_save_upload($source, $vali $file->timestamp = REQUEST_TIME; drupal_write_record('files', $file); + // Give everyone read access so that FTP'd users or non-webserver users + // can see/read these files, and give group write permissions so group + // members can alter files uploaded by the webserver. + @chmod($file->filepath, 0664); + // Add file to the cache. $upload_cache[$source] = $file; return $file; Index: modules/simpletest/tests/file.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v retrieving revision 1.5 diff -u -p -r1.5 file.test --- modules/simpletest/tests/file.test 20 Sep 2008 07:35:53 -0000 1.5 +++ modules/simpletest/tests/file.test 2 Oct 2008 06:39:03 -0000 @@ -351,6 +351,7 @@ class FileSaveUploadTest extends FileTes // FIXME: Replace with file_load() once the hook_file patch gets committed. $file = db_fetch_object(db_query('SELECT f.* FROM {files} f WHERE f.fid = %d', array($max_fid_after))); $this->assertTrue($file, t('Loaded the file.')); + $this->assertFilePermissions($file->filepath, 0664); } }