Closed Bug 1154955 Opened 9 years ago Closed 7 years ago

OS.file.open with |write| mode does not fail even if target file has no write permission on B2G

Categories

(Toolkit Graveyard :: OS.File, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: hiro, Unassigned)

References

Details

Attachments

(3 files)

Attachment file is a POC, you can easily confirm this issue.
Flags: needinfo?(dteller)
The root cause is that |open| in bionic is a variadic function. So this issue will happen on Android too.
If you have a clear idea on how to fix this, hiro, I can review your patch.
Flags: needinfo?(dteller) → needinfo?(hiikezoe)
There is another issue in osfile_unix_front.jsm.

The third argument of open() is set if not creation mode.
Flags: needinfo?(hiikezoe)
Now I just pushed these patches on try.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ac5101dab47b

I will request review after the try result looks good.
The try failed. 
The test I added in patch does sometimes fails.

I am guessing some other issues remain there.
I've been totally misunderstanding this issue.

The *real* root cause of this issue is that xpcshell test runs with root privilege on b2g emulator.

So test relying on no write access like test_error_target in common_test_Download.js fails on b2g emulator.
Closing this old B2G bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: