Project

General

Profile

Actions

Patch #24186

closed

Restrict the length attachment filenames on disk

Added by Holger Just over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When uploading a file with a very long name, the disk_filename might be too long to be stored on the server's filesystem.

Since Redmine always prepends the timestamp to the name of the uploaded file, the final disk_filename will be longer than 255 characters (the common limit for filenames on most file systems) if the original filename is between 240 and 255 characters long. If that is the case, the attachment save will fail with a Errno::ENAMETOOLONG exception when attempting to write the file to disk.

The attached patch by Planio fixes this behavior by restricting the length of the filename 50 characters (to have some breathing room on unusual file systems). In that case, we just use the ASCII fallback we already have in place.


Files

Actions #1

Updated by Toshi MARUYAMA over 7 years ago

  • Category set to Attachments
  • Target version set to 3.4.0
Actions #2

Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

Actions

Also available in: Atom PDF