Closed Bug 123869 Opened 23 years ago Closed 23 years ago

[FIX]SaveAs dialog pops up dialog 'You are not allowed to view the contents of the dir'

Categories

(Core :: XUL, defect, P1)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: BenB, Assigned: bzbarsky)

Details

(Keywords: regression)

Attachments

(1 file)

Reproduction (under Unix; Windows 200 will differ):
0. cd /tmp
1. su root
2. mkdir downloads
3. chown root downloads
4. chgrp yourgroup downloads
5. chmod 730 downloads
   (So you get drwx-wx--.
   This means, your normal user can write to the directory and can read files
   with known filenames, but cannot list the contents of the directory.)
6. exit
7. ls downloads (you should get a "Permission denied")
8. Start Mozilla
9. Click to download a file
10. In the SaveAs dialog, walk to /tmp
11. Enter "downloads/myfile.tgz" as filename
12. Click Save button
    (The file should be correctly saved in as /tmp/downloads/myfile.tgz.)
13. Click to download another file

Actual result:
The SaveAs dialog displays, defaulting to /tmp/downloads/, but another error
dialog pops up above it, telling you that the contents if the dir cannot be
shown. You have to confirm it by clicking OK before you can proceed.

Expected result:
No dialog pops up. If a message is shown at all (which is preferable), then it
shoudl be shown in the listbox, where the contents of the dir usually appear.

Rationale:
I intentionally created a directory with these permissions as downlaod dir to
protect the downloaded files from potential intruders (I could explain that
more, but I'd need half a page for it). The popup dialog is very annoying,
because it pops up *every time* I want to download a file, and I have to click
it away *every time*. Talk about needless confirmation dialogs...

Additional Comments:
This didn't happen with 0.9.4.1.
Keywords: regression
Summary: SaveAs dialog displays 'You are not allowed to view the contents of the dir' → SaveAs dialog pops up dialog 'You are not allowed to view the contents of the dir'
-> bryner

Bryner, could we do something where instead of showing this dialog we place a
"Can't display contents" in the listbox?
Assignee: jaggernaut → bryner
-> bzbarsky.  This sounds like it's related to your checkin for bug 117228.
Assignee: bryner → bzbarsky
Bug 114399, actually, but same thing.

Will look into doing something non-dialog-like here.
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla0.9.9
Attached patch Patch v 1.0Splinter Review
Uses a <deck> to show the "Directory not readable" message instead of alerting
it.
Ben, would you test this and see what you think?

bryner, would you review?
Summary: SaveAs dialog pops up dialog 'You are not allowed to view the contents of the dir' → [FIX]SaveAs dialog pops up dialog 'You are not allowed to view the contents of the dir'
Yes, fix seems to work fine. Thanks for the fast and good fix!
There is a bug in the fix: If I manually enter a dir that is viewable, e.g. I
type "/tmp" in the filename field and hit return, the dialog without the fix
shows the contents of the new directory. With the fix, the message 'No
permission" retains.
Um... I can't reproduce that one.  I pick save as from menu, get the filepicker
opened to /tmp/foo (which is not readable) and showing the error message, I type
"/tmp" in the filename field, hit enter, and get a listing for "/tmp".

Are your steps any different from those?
No, apart from that I use Save Link As..
I use something around 0.9.8 branching and had to merge one part manually. I am
updating HEAD atm, to see if that fixes it and to check that I applied the patch
correctly.
Comment on attachment 68324 [details] [diff] [review]
Patch v 1.0

r=bryner
Attachment #68324 - Flags: review+
What I reported as "bug" was caused my wrong manualy merging on my part. Sorry.
It all works very well.
Comment on attachment 68324 [details] [diff] [review]
Patch v 1.0

sr=jag
Attachment #68324 - Flags: superreview+
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: jrgm → sairuh
vrfy'ing per BenB.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: