Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Ask for root password when required #4115

Closed

Description

@alexandernst

Some files require root permissions to be edited, but sometimes those files are already modified when one realizes those files require said permissions. It would be nice if Atom could ask for the root password and apply the changes instead of having to close the file, close Atom, open Atom with root privileges and re-edit the file.

Activity

  1. kevinsawicki commented on Nov 10, 2014

    @kevinsawicki
    Contributor

    What platform are you on? I thought this was already supported on Mac OS X

  2. alexandernst commented on Nov 10, 2014

    @alexandernst
    Author

    I just tried that with .144 on Linux. Instead of saving the changes, or maybe warning that the changes weren't saved, Atom actually shows the devs console with this message:

    Uncaught Error: EACCES, permission denied '/etc/fstab' /usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:311
    
  3. added
    linux
    on Nov 10, 2014
  4. lee-dohm commented on Nov 10, 2014

    @lee-dohm
    Contributor

    @kevinsawicki Should this be considered a bug since it is supported on Mac but either not supported or not working on Linux?

  5. kevinsawicki commented on Nov 10, 2014

    @kevinsawicki
    Contributor

    @lee-dohm Yeah, it should be.

  6. alexandernst commented on Nov 10, 2014

    @alexandernst
    Author

    Also, please note that I'm not really sure how would that work on Windows, which also requires special permissions (kind of).

  7. self-assigned this
    on Jan 9, 2015
  8. benogle commented on Jan 9, 2015

    @benogle
    Contributor

    This is currently supported in OSX when writing a file, but not when reading. With the addition of atom-archive/node-runas#14 we can support this in read (though with a blocking read all at once).

  9. alexandernst commented on Jan 9, 2015

    @alexandernst
    Author

    Read all at once is a complete no-no. It will be slow and it will block the entire editor.

  10. benogle commented on Jan 9, 2015

    @benogle
    Contributor

    Word. Problem is that because of the privilege escalation, the read needs to happen in another process. So the 'right' way would need to be some kind of ipc streaming (via stdout?) in runas.

  11. alexandernst commented on Jan 9, 2015

    @alexandernst
    Author

    That would be an option, yes. Escalate the "reader" process and then send the content of the file to Atom.

    One major drawback of that is that you'll be actually sending X amount of data via IPC (or any other mechanism) from one process to another. What happens if you open a 60mb file? Sending 60mb via IPC doesn't sound like a good idea.

    A better approach would be to create a privileged "reader" process than can both send and receiver signals from Atom. When the "reader" is running, Atom can ask the "reader" just for the right chunks of the file (for example, from line 1 to line 100 or from byte 943 to byte 1237). That way you'll have a no-blocking reader that won't be resource-hungry.

  12. alexandernst commented on Jan 9, 2015

    @alexandernst
    Author

    Btw, having in mind what I just said, this seems just the right moment to think about issue #307

    Refactor Atom to actually use reader processes to read files and ask those readers only for the exact amount of data required by the user.

  13. 7 remaining items

  14. TimTinkers commented on Nov 28, 2018

    @TimTinkers

    I don't think @benogle works on Atom anymore. Since this is Atom's oldest Linux bug maybe it should be reassigned.

  15. dluxcru commented on Jan 15, 2019

    @dluxcru

    Just so atom developers know, this is still something we Linux users need. Especially since gksu is dead.

  16. covertg commented on Mar 24, 2019

    @covertg

    Not a full solution, but the package susave provides an ok workaround for me. Unfortunately it hasn't been updated in a few years—I had to disable "Try Default Save," and even then it doesn't seem to communicate to Atom that the file has been updated. Just wanted to share for anyone else finding this issue.

  17. self-assigned this
    on May 27, 2019
  18. lock commented on Nov 25, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  19. locked as resolved and limited conversation to collaborators on Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugd ⬆️i ⬆️linuxv ⬇️

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions