I'm not sure about why this happens in my situations and not for other web server configurations; perhaps it is related to safe mode or suPHP or just plain old operating system settings... But I suspect it might make sense to work around this in the module itself.

Here's what happens:

  • Image resize filter creates /files/resize/picture-40x40.jpg with owner 'me:www-data' and access rights 0600.
  • The resized image can not be served over HTTP since the webserver in group 'www-data' has no read rights on it. Access permissions should have been 0640 instead of 0600.

I have a workaround that chmod()s the resized image file, but I'm not sure if this is the right place to fix this.

If it is the right place, then what is the recommended place to configure such behaviour? Or can I safely assume that 0640 is the correct mode for everyone?

CommentFileSizeAuthor
#1 image_resize_filter_chmod.patch688 bytesquicksketch

Comments

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new688 bytes

Looks like core might be partially responsible for this #203204: Uploaded files have the permissions set to 600, though it's common practice in many other modules (color, imce, imageapi, filefield) to set these permissions manually. I've committed the attached patch which should set the permissions to 664.

florisla’s picture

Thanks, that's the line of code I had added myself too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.