Last Comment Bug 718752 - Cannot open read-only file anymore using nsFilePicker
: Cannot open read-only file anymore using nsFilePicker
Status: VERIFIED FIXED
[qa!]
: regression
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: 11 Branch
: x86 Windows 7
: -- normal (vote)
: mozilla12
Assigned To: Jim Mathies [:jimm]
:
: Jim Mathies [:jimm]
Mentors:
Depends on:
Blocks: 661991
  Show dependency treegraph
 
Reported: 2012-01-17 11:14 PST by Stefan Sitter
Modified: 2012-02-03 00:25 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
verified


Attachments
patch (757 bytes, patch)
2012-01-17 13:42 PST, Jim Mathies [:jimm]
no flags Details | Diff | Splinter Review
patch (1.17 KB, patch)
2012-01-17 14:14 PST, Jim Mathies [:jimm]
netzen: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Stefan Sitter 2012-01-17 11:14:52 PST
I have several local ics calendar files that are marked as read-only on file system level.

Using menu File > Open > Calendar File to subscribe to them as a new calendar doesn't work anymore. I only get a Windows error message that the file is read-only and I need to choose a different file.

Fails using Lightning 1.4a1 + Thunderbird 12.0a1
Fails using Lightning 1.3a2 + Thunderbird 11.0a2
Works using Lightning 1.2b2 + Thunderbird 10.0
Comment 1 Stefan Sitter 2012-01-17 12:19:45 PST
Seems to be a toolkit issue and can be reproduce using Firefox too.

Steps to Reproduce using Firefox:
1. Create file on local harddisc and mark it as read-only, e.g. a html webpage file.
2. In Firefox use menu File > Open File... and select the file

Actual result:
An error dialog stating that the file is read-only and a different file should be selected.

Expected result:
File is opened and the content is displayed.

Works in Firefox 10. Fails in Firefox 11.
Comment 2 Jim Mathies [:jimm] 2012-01-17 13:27:16 PST
Hmm, not able to reproduce. I created the file as an admin, created a new standard user account, and marked the file for read-only access for that user. Then opened the file with the File->open dialog under the test account. Didn't have any problems. I will experiment some more. Maybe there is something unique set up that I might be missing?
Comment 3 Jim Mathies [:jimm] 2012-01-17 13:31:41 PST
Testing the regression range might help - those patches landed 2011-12-14, so they would be in the 12-15 build:

http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/

The zips of these builds make this pretty easy to test if you have some spare time Stefan.
Comment 4 Jim Mathies [:jimm] 2012-01-17 13:37:47 PST
I think I can see the potential cause though - 

http://mxr.mozilla.org/mozilla-central/source/widget/windows/nsFilePicker.cpp#896

FOS_NOREADONLYRETURN should only be applied if mMode == modeSave.
Comment 5 Jim Mathies [:jimm] 2012-01-17 13:40:04 PST
In fact, it's the default value - 

FOS_NOREADONLYRETURN - Do not return read-only items. This is a default value for the Save dialog.

patch coming up.
Comment 6 Jim Mathies [:jimm] 2012-01-17 13:42:37 PST
Created attachment 589286 [details] [diff] [review]
patch
Comment 7 Jim Mathies [:jimm] 2012-01-17 14:14:04 PST
Created attachment 589298 [details] [diff] [review]
patch

minor update on this - there's a mode case statement further down I can use.
Comment 8 Brian R. Bondy [:bbondy] 2012-01-17 16:17:54 PST
Comment on attachment 589298 [details] [diff] [review]
patch

Review of attachment 589298 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. 

Tested and everything is working correctly.
Tested on XP and it works consistent with the new functionality in this patch.
Comment 9 Stefan Sitter 2012-01-18 01:19:48 PST
Regression range: Works in 11.0a1 (BuildID: 20111214031134)
                  Fails in 11.0a1 (BuildID: 20111215031153)
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=fd6ab19f312c&tochange=beac16509534

I'm not aware of anything special regarding setup. Windows 7 with NTFS file system. Same standard user is used to create the file, mark it read-only via context menu > properties > attributes, and running Firefox (fresh profile).
Comment 10 Jim Mathies [:jimm] 2012-01-18 05:32:28 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/0e424ab9ddff

Let's get this into a nightly and test to see if it addresses the problem. My guess is it will.
Comment 11 Marco Bonardo [::mak] 2012-01-19 02:39:23 PST
https://hg.mozilla.org/mozilla-central/rev/0e424ab9ddff
Comment 12 Jim Mathies [:jimm] 2012-01-19 08:09:31 PST
Comment on attachment 589298 [details] [diff] [review]
patch

Another file pickers fix, the new file pickers code is in aurora so we need to get this in too. Low risk.
Comment 13 Stefan Sitter 2012-01-20 08:45:28 PST
Verified fixed using Mozilla/5.0 (Windows NT 6.1; rv:12.0a1) Gecko/20120120 Firefox/12.0a1.
Comment 14 Alex Keybl [:akeybl] 2012-01-23 09:05:04 PST
Comment on attachment 589298 [details] [diff] [review]
patch

[Triage Comment]
New file picker in 11, needed on Aurora.
Comment 16 Ioana (away) 2012-02-03 00:25:09 PST
Verified as fixed on:
Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0

Read-only files are selected and opened without any issues.

Thunderbird could not be tested since there is no Lightning version compatible with 11b1.

Note You need to log in before you can comment on or make changes to this bug.