Community
Participate
Working Groups
Created attachment 283070 [details] Patch that reintroduces old test as fallback The fix for bug 558612 seems to have caused a regression when the configuration is in a location which is writable but for which access cannot be determined by Files.isWritable(). For such locations, Files.isWritable() is documented to return false, which the new code falsely assumes to mean that write access would be denied. Repeat on Windows: 1. Create a folder C:\tmp\secretivefolder where reading permissions is denied*. 2. Launch (4.15+) eclipse.exe -configuration C:/tmp/secretivefolder 3. Note that an error message about write access appears Expected: The launcher should happily accept this secretive location, like earlier versions do (e.g. 4.7.2). *One way to create a secretive folder: 1. Go into "Properties" and click "Advanced" 2. Change the owner to someone else, e.g. the local "Administrators" group (since if you own the folder yourself, you can always read permissions) 3. Add an explicit deny rule for yourself for "Read permissions" 4. Apply Of course, the regression wasn't noticed by creating strange permissions like this but rather because of the configuration location being in a home directory on a Samba file share that apparently effectively was secretive about its permissions. I have attached the fix I applied locally. With this fix, canWrite() still uses Files.isWritable() as an early exit opportunity when it returns true, for which its documentation is less ambiguous, but after that it also tries the old algorithm from before the fix for bug 558612. I believe that the proposed fix strikes a good balance between keeping the behavior of the fix for bug 558612 for 99% of all cases, but still not regressing in which configuration locations are accepted (and also being true to the letter of the Files.isWritable() documentation). I.e. if your folder is secretive about its permissions, you'll have to live with Eclipse creating a file inside it to find out for itself. Notably, if Files.isWritable() returns false due to the folder actually not being writable (also 99% of such cases), trying to write into it shouldn't do any harm since it will fail. PS. The code brought back from the dead contains a comment that was questioned in bug 5444263, and a spelling error ("writtable"). I didn't touch either to make it clear that it's a revert, but maybe now is a good chance to sneak in a correction/clarification.
Created attachment 283071 [details] Screenshot of error message
Created attachment 283072 [details] Screenshot of creating a secretive folder, Properties window
Created attachment 283073 [details] Screenshot of creating a secretive folder, changing owner
Created attachment 283074 [details] Screenshot of creating a secretive folder, denying reading permissions
Created attachment 283075 [details] Screenshot of creating a secretive folder, Advanced window end-result
@Mickael, can you please sign ECA (click on the red badge next to your name) and push a Gerrit? It is not allowed to accept patches from contributions without ECA.
Should fix in 4.17 now that we are in our final RC for 4.16.
New Gerrit change created: https://git.eclipse.org/r/163842
Sorry for the newbie question, but should I interpret the failed gerrit build as it being my responsibility to update the manifest version of org.eclipse.equinox.launcher in my commit? [ERROR] Failed to execute goal org.eclipse.tycho.extras:tycho-p2-extras-plugin:1.7.0:compare-version-with-baselines (compare-attached-artifacts-with-release) on project org.eclipse.equinox.launcher: Only qualifier changed for (org.eclipse.equinox.launcher/1.5.700.v20200529-1312). Expected to have bigger x.y.z than what is available in baseline (1.5.700.v20200207-2156) -> [Help 1]
(In reply to Mikael Sterner from comment #9) > Sorry for the newbie question, but should I interpret the failed gerrit > build as it being my responsibility to update the manifest version of > org.eclipse.equinox.launcher in my commit? Exact, additionally also pom.xml where the same version must be updated too. Please note, that we are in RC2 period, so no merges are planned except you have a really good reason and project lead approves. So expect the patch to be reviewed / merged for 4.17.
(In reply to Mikael Sterner from comment #9) > Sorry for the newbie question, but should I interpret the failed gerrit > build as it being my responsibility to update the manifest version of > org.eclipse.equinox.launcher in my commit? For a newbie you were quick to get the gerrit going! Thanks for the contribution we should be able to get this in for early 4.17 M1.
Thanks, I have updated my submission. Targeting 4.17 is completely fine with me.
Apologies for not getting this in for M1. I will release a fix as soon as M1 is done this week. We do need the same fix in org.eclipse.osgi.storage.StorageUtil.canWrite(File)
Gerrit change https://git.eclipse.org/r/c/equinox/rt.equinox.framework/+/163842 was merged to [master]. Commit: http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=5d23e0fa4b3831e10ffa789a93e07e41beb34296
Will be in the next milestone.