When the file upload system was changed with #115267: Simplify File Uploads, Centralize File Validation and Quotas, Fix File Previews.... in Drupal 6. we forgot to set the new file permissions after moving the file. This works fine in Drupal 5. The attached patch fixes this for Drupal 6.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix_upload_perms-D6.patch | 742 bytes | anarcat |
| #4 | fix_upload_perms-D6.patch | 760 bytes | anarcat |
| #4 | fix_upload_perms.patch | 789 bytes | anarcat |
| #1 | 339539.patch | 533 bytes | douggreen |
Comments
Comment #1
douggreen commentedComment #2
Bevan commentedThis applies and works for me on drupal.geek.nz. I have been running a script that fixes file permissions on a cron to work around this, so this would be a very useful bug fix!
I uploaded a file without the patch, access denied. I uploaded a file with the patch; I could access it.
Comment #3
flickerfly commentedJust ran into the same problem. The patch successfully fixes this. The lack of activity on this bug puzzles me. Does no one use the core upload module anymore?
Comment #4
anarcat commentedI have reviewed and tested this patch and it works fine here. Unless that change was a policy decision (in which case it should have been made more explicit), I think this fix could go in.
I am attaching a patch that adds comments around the chmod, copied from file_unmanaged_copy().
I am also attaching a port to HEAD of the patch, since it seems D7 also suffers from this problem.
Comment #5
anarcat commentedHum, sorry about that double D6 patch, the right one is 760 bytes.
Comment #6
anarcat commentedI am fixing the issue title to reflect better the issue at hand.
Note that I noticed this issue because of another issue, in the Hostmaster project: #363282: backups failing on drupal 6 and above.
Comment #7
damien tournoud commentedThis is a duplicate of #203204: Uploaded files have the permissions set to 600.
Comment #8
Warren-M commentedWhat do we do with this patch? Are there instructions for using/installing/placing it?
Never mind. This is not related to my problem which has been solved:
http://drupal.org/node/141935#comment-1244627
Thanks, Warren
Comment #9
Andrew Schulman commentedsubscribing
Comment #10
xmarket commentedPlease import this patch as soon as possible. It cause problem too, when you running php as fastcgi daemon and apache with SuExec.
The apache serving files directly on my site, and I still need to patch the drupal core because of this bug. It's really embarrassing :S
Comment #11
xmarket commentedComment #12
wretched sinner - saved by grace commented@xmarket Please do not change the status. This has been marked as a duplicate of #203204: Uploaded files have the permissions set to 600. If you think this is still a problem, please read the other issue, and continue the discussion there.
Comment #13
flickerfly commentedanarcat or douggreen, could you submit your patch to #203204: Uploaded files have the permissions set to 600? I'd like to see this get attention and I think that would allow a status change on that from 'patch (to be ported)' to 'needs review' which may even allow it to get into the next security update, maybe?
Comment #14
prodosh commentedWhile this has been marked as a duplicate of "#203204: Uploaded files have the permissions set to 600", that issue contains a patch for D7 whereas this issue contains a patch for D6.
Comment #15
damien tournoud commentedPlease do not reopen duplicate issues. Concentrate on back-porting #203204: Uploaded files have the permissions set to 600 if you want this to ever get into Drupal 6.