Closed Bug 823191 Opened 10 years ago Closed 10 years ago

DeviceStorage enumerate doesn't see files with 0060 perms

Categories

(Firefox OS Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-basecamp:+, firefox19 fixed, firefox20 fixed, b2g18 fixed)

RESOLVED FIXED
blocking-basecamp +
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
b2g18 --- fixed

People

(Reporter: dhylands, Assigned: dougt)

References

Details

Attachments

(1 file)

After applying attachment 693997 [details] [diff] [review] then the Gallery and Music apps no longer see files on the sdcard.

There are 2 reasons (that I can think of) which might be happening:

1 - The enumeration is happening in the child process (which would no longer have access)

2 - Even though the parent is running as root, it may still need to be a member of the sdcard_rw group in order to see the files (although I would have expected that if the parent process were using "other" priviledge then it shouldn't have been able to write anything - so my bet is still on 1)
noming since this blocks a blocker
blocking-basecamp: --- → ?
Enumeration should be happening in the parent process already. So my guess is that the problem is the #2 one.
Another possibility is that maybe the mediadb stuff is trying to directly open the files to parse the metatag info?
It seems that DeviceStorage is returning the list of files fine.

The failure is occuring in mediadb.js here:

    function parseMetadata(file, filename) {
      if (!file.lastModifiedDate) {

and this causes:

[JavaScript Error: "NS_ERROR_FILE_ACCESS_DENIED: Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIDOMFile.lastModifiedDate]" {file: "app://gallery.b2g.hylands.org/shared/js/mediadb.js" line: 1189}]

So the file access is happening from the content process which fails because there is no permission.

So either this needs to be remoted, or devicestorage needs to provide the information so that mediadb.js doesn't need to try and access the locally.
file should be a remoted blob.  does file.length return without error?
We use fstat in here right?
unrelated.  the stat should happen in the parent process on the IO thread and be remoted down as part of the remote blob other meta info (like length).
the problem is that the we do not remember the last modification date.  The blob is created without one.
Assignee: nobody → doug.turner
blocks a blocker, also pretty sure we can't ship w/o being able to use media files :)
blocking-basecamp: ? → +
Attached patch patch v.1Splinter Review
Attachment #694520 - Flags: review?(bent.mozilla)
Continue() makes the call if it should execute Run() or dispatch to the parent process.
works on device and locally.  sent to try, awaiting results.
Attachment #694520 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/fb4836c277eb
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.