| Summary: | EFS.ATTRIBUTE_IMMUTABLE is not set along with EFS.ATTRIBUTE_READ_ONLY any more | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Szymon Brandys <Szymon.Brandys> | ||||||||||
| Component: | Resources | Assignee: | Malgorzata Janczarska <malgorzata.tomczyk> | ||||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||||
| Severity: | major | ||||||||||||
| Priority: | P3 | Flags: | Szymon.Brandys:
review+
|
||||||||||
| Version: | 3.7 | ||||||||||||
| Target Milestone: | 3.7 M5 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Szymon Brandys
You can also see it, when you run the test attached to Bug 323833, see 'Fixed patch'. I committed Bug_329836.java to core.tests.resources. It illustrates the problem. When you have the fix, please add the test to the suite. Please also add TestBug323833.java to the suite, when you fix the bug. Created attachment 182791 [details]
Test suites update
Gosia, please investigate during M5. Created attachment 185997 [details]
Patch switching SF_IMMUTABLE to UF_IMMUTABLE
I think I?ve discovered where the problem lies. Look at UnixFileNatives.puFileInfo(String, IFileInfo, int), is sets/unsets immutable flag by using system chflags command. There are two system flags that may mean that file is immutable: SF_IMMUTABLE and UF_IMMUTABLE. When we want to set immutable to FALSE we are trying to switch both flags off, when we want to set immutable to TRUE we are only switching the SF_IMMUTABLE flag on.
This is what chflags manual says about flags:
______
The ``UF_IMMUTABLE'', ``UF_APPEND'', ``UF_OPAQUE'', and ``UF_HIDDEN'' flags may be set or unset by either the owner of a file or the super-user.
The ``SF_ARCHIVED'', ``SF_IMMUTABLE'' and ``SF_APPEND'' flags may only be set or unset by the super-user. They may be set at any time, but normally may only be unset when the system is in single-user mode. (See init(8) for details.)
______
We are not running our tests as super-user, so setting the SF_IMMUTABLE flag on fails. When I?ve changed flag to UF_IMMUTABLE everything works fine, so this would be probably a solution to this defect.
As for setting both flags off for immutable=false I think it was done on purpose, because if the SF_IMMUTABLE flag is already off this command will only change UF_IMMUTABLE and changing SF_IMMUTABLE is added only for rare situations where the flag is on and we are a super-user.
Created attachment 185998 [details]
mylyn/context/zip
Created attachment 186019 [details]
Combined patches.
Combined all the patches and modified Bug_329836 test to check if it's unsetting immutable flag as well.
In HEAD. Thanks Gosia. Verified by code inspection. |