Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-10566

Attachments with invalid filenames not stored/served correctly with mod_jk and mod_proxy

XMLWordPrintable

      Say a Windows user attaches a file called "5/4/06_test.txt" to an email, and sends it to JIRA (polling a POP/IMAP service) running on unix. JIRA creates an issue or comment with this attachment. However it prints a warning:

      2006-07-07 11:31:23,038 WARN [jira.issue.managers.DefaultAttachmentManager] Creating attachment without a file.  Aborting
      

      and in the attachments directory, one finds the file saved, but in an invalid/unusual format, with a subdirectory:

      ./10003_5/4/06_test.txt

      The URL to the attachment will be something like:

      http://localhost:8090/jira/secure/attachment/10003/5%2F4%2F06_test.txt

      This URL works with Tomcat, but mod_proxy and mod_jk don't like it. One gets the error:

      Not Found
      
      The requested URL /jira/secure/attachment/10003/5/4/06_test.txt was not found on this server.
      Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.2.3 mod_python/3.1.3 Python/2.3.5 PHP/4.4.0-4 mod_perl/2.0.1 Perl/v5.8.7 Server at localhost Port 80
      

      To fix this we need to check filenames for invalid characters ("/"), and if present, store the file on disk with the invalid characters stripped. Since the name the file is served as is stored in the database, it doesn't actually matter what the filename on the server is - it will be served to the user correctly.

              Unassigned Unassigned
              7ee5c68a815f Jeff Turner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: