Bug 1127972

Summary: A long unsegmented path + filename length causes an exception
Product: [Retired] Zanata Reporter: Damian Jansen <djansen>
Component: Component-UIAssignee: David Mason <damason>
Status: CLOSED UPSTREAM QA Contact: Zanata-QA Mailling List <zanata-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4CC: zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-29 02:47:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Damian Jansen 2014-08-08 03:05:50 UTC
Description of problem:
From https://github.com/zanata/zanata-server/pull/400
The path field is not limited, so a user can enter a path that is greater than the 255 character limit.
This merely causes a IllegalArgumentException that is caught by seam, and displays a "failed to upload" message, but should not be allowed.

Added to that, if the combination of last segment (last index of '/' - end) of the path and the filename length are greater than the standard 255 characters, it should warn that the op is likely to fail.

Version-Release number of selected component (if applicable):
3.4

How reproducible:
Easy always

Steps to Reproduce:
1. Sign in as a maintainer, go to project
2. Click Settings, Documents, then the [+] button
3. Enter a very long (255+) string in the path, that contains no "/" characters 
4. click browse->select a file to upload, click Open
5. Press the upload button

Actual results:
"Failed to upload"
12:36:57,908 WARN  [org.jboss.seam.mock.MockViewHandler] (http-/127.0.0.1:8080-2) You should catch the exception before Seam: java.lang.IllegalArgumentException: no file extension in servlet path: /files/upload

Expected results:
Limited 

Additional info:

Comment 1 Zanata Migrator 2015-07-29 02:47:22 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-193