Bug 1013688

Summary: No warning when attachment is not readable
Product: [Community] Bugzilla Reporter: Jiri Koten <jkoten>
Component: Attachments/RequestsAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED NOTABUG QA Contact: tools-bugs <tools-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 4.4CC: jmcdonal, rjoost
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 00:56:03 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 Jiri Koten 2013-09-30 15:30:57 UTC
Description of problem:
I tried to submit an attachment without read permissions and bugzilla didn't show any warning about it. Clicking Submit didn't produce any action and I had to figure out on my own where the problem was.  

It's a regression as bugzilla used to inform when it wasn't able to submit the attachment.

Version-Release number of selected component (if applicable):
version 4.4.0007-1

How reproducible:
100%

Steps to Reproduce:
1. Try to submit an attachment without read permissions
2.
3.

Actual results:
Nothing happens

Expected results:
Bugzilla warns that the attachment cannot be submitted.

Additional info:

Comment 1 Jason McDonald 2013-10-01 00:32:59 UTC
I can reproduce this problem.  If I create an unreadable file with "touch foo.txt ; chmod 200 foo.txt" then try to submit it as an attachment, nothing seems to happen when I press the Submit button.

If I subsequently "chmod 600 foo.txt" then press the Submit button again, the broswer loads attachment.cgi, which shows the following error message: "The file you are trying to attach is empty, does not exist, or you don't have permission to read it."

This message presumably occurs because the file I created is now readable but empty.  I would have expected that the same thing should happen when the file is unreadable.

Comment 2 Jason McDonald 2013-10-01 00:56:03 UTC
After a little more investigation, I think this is caused by a change in your browser rather than a regression in Red Hat Bugzilla.

Using Firefox 23.0.1, I see the behaviour described in Comment #1.  Using Konqueror 4.11.1, I see the "The file you are trying to attach is empty, does not exist, or you don't have permission to read it." error message both when the file is unreadable and when it is empty.

Konqueror appears to be submitting an empty file in both cases, while Firefox is silently refusing to submit the form when the file is unreadable.

The Firefox behaviour does seem rather unhelpful and really should tell the user that the file cannot be submitted.  Therefore, I suggest that you file a bug against Firefox via https://bugzilla.mozilla.org/enter_bug.cgi#h=dupes|Firefox