History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRA-14686
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Dushan Hanuska [Atlassian]
Reporter: W. van Beelen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

Manual Backup Data to XML fails without warning when filename contains a colon character under WinXP.

Created: 21/Mar/08 04:46 PM   Updated: 27/Mar/08 01:55 AM
Component/s: Import / Export
Affects Version/s: 3.12.2
Fix Version/s: 3.12.3

Time Tracking:
Original Estimate: 2 hours
Original Estimate - 2 hours
Remaining Estimate: 0 minutes
Time Spent - 2 hours
Time Spent: 2 hours
Time Spent - 2 hours

Environment:
JIRA: Standalone JIRA-Standard-3.12.2
Database: MySQL
OS: Windows XP
JAVA: 1.6.0

Participants: Dushan Hanuska [Atlassian], Timothy Chin [Atlassian] and W. van Beelen
Since last comment: 16 weeks, 5 days ago
Resolution Date: 27/Mar/08 01:55 AM
To be done by: Single developer
Labels: Backup XML colon windows


 Description  « Hide
On manually creating a Backup XML file of JIRA I accidentally typed a file name with a colon ( ":" ) character inside the file name.
JIRA reports the file was created successfully but it only creates an empty file, obviously because windows can't handle filenames with colon characters. So it should have reported that the filename wasn't correct.

I checked the other special characters (\/*?<>) but for those it does rightfully create an error message.

Replication steps:
Administration window
Backup data to XML
Type file name: "C:/JIRA/Backups/Test_:.xml" or "C:/JIRA/Backups/Test:_.zip" (note colon char in the filename)
JIRA reports: "Data exported to C:\JIRA\Backups\Test_:_.xml."
Now check backups folder.
It should have created a empty file: "Test_"



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
W. van Beelen - 21/Mar/08 04:53 PM
Hmm, it seems I've hit a text shortcut for italic text somewhere in the filename in the description field, but I think the description is clear enough.

Timothy Chin [Atlassian] - 25/Mar/08 12:33 AM
Hi,

I am able to reproduce this bug with 3.12.2 standalone and source. Steps used to replicate is as the user has mentioned.

DataExport.java
else if (filename != null) // write to XML file
{
  log.debug("Writing XML file");
  outputStream = getFileOutputStream(filename);
}

The filename passed here is "C:/te:st.xml". It seems that getFileOutputStream() method does not check whether the string passed in is valid or not. It does not check for ":" character. This method will instead create a file called te with no extension at C drive. Therefore, when the output is written, it cannot be written to the file.

I believe that the getFileOutputStream() method thinks that it is writing to "C:/te:st.xml" but "C:\te" was created.

Regards,
Timothy