jessegrosjean / foldingtext-for-atom

Outline editor with productivity features (No longer in development)
Other
40 stars 10 forks source link

macOS - Privilege escalation functionality being removed from atom's `File` API #90

Open maxbrunsfeld opened 7 years ago

maxbrunsfeld commented 7 years ago

Hi! Thanks for maintaining the foldingtext-for-atom package!

I noticed that this package uses the File.writeSync method exported by atom. In an upcoming Atom release, (possibly Atom 1.19.3), this method's functionality will change slightly:

On macOS, when attempting to save a file for which the current user does not have write permissions, the method will no longer prompt the user for their credentials to save the file; it will simply throw an exception with the EACCES code.

After a major change to Atom's text buffer system, the functionality for escalating privileges has been reimplemented at another layer, and is now asynchronous. We are removing the ability to synchronously save a file with escalated privileges.

If you want to preserve the ability to save files owned by root on macOS, you could switch to saving files asynchronously and doing something similar to this PR, which uses the new spawn-as-admin module.

Let me know if you have any questions; I'd be glad to help.