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.

Uncaught Error: EACCES, permission denied '/etc/hosts' #5421

Closed

Description

@benogle

From @iivanovicpu on February 5, 2015 8:47

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.176.0
System: linux 3.16.0-30-generic
Thrown From: tabs package, v0.64.0

Stack Trace

Uncaught Error: EACCES, permission denied '/etc/hosts'

At /usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:318

Error: EACCES, permission denied '/etc/hosts'
  at Error (native)
  at Object.fs.openSync (fs.js:455:18)
  at Object.module.(anonymous function) [as openSync] (/usr/share/atom/resources/atom/common/lib/asar.js:422:20)
  at Object.fs.writeFileSync (fs.js:1011:15)
  at Object.fsPlus.writeFileSync (/usr/share/atom/resources/app/node_modules/fs-plus/lib/fs-plus.js:228:17)
  at File.module.exports.File.writeFileSync (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:234:19)
  at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:304:21)
  at File.module.exports.File.write (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:293:12)
  at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:970:17)
  at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:958:19)
  at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app/src/text-editor.js:620:26)
  at Pane.module.exports.Pane.saveItem (/usr/share/atom/resources/app/src/pane.js:538:16)
  at Pane.module.exports.Pane.promptToSaveItem (/usr/share/atom/resources/app/src/pane.js:511:23)
  at Pane.module.exports.Pane.destroyItem (/usr/share/atom/resources/app/src/pane.js:456:18)
  at HTMLDivElement.<anonymous> (/usr/share/atom/resources/app/node_modules/tabs/lib/tab-bar-view.js:174:22)
  at space-pen-ul.jQuery.event.dispatch (/usr/share/atom/resources/app/node_modules/jquery/dist/jquery.js:4430:9)
  at space-pen-ul.elemData.handle (/usr/share/atom/resources/app/node_modules/jquery/dist/jquery.js:4116:28)

Commands

  3x -0:35.8 core:move-down (atom-text-editor.editor)
     -0:33.5 editor:newline (atom-text-editor.editor)
     -0:33.2 core:move-up (atom-text-editor.editor)
     -0:32.1 core:paste (atom-text-editor.editor)
     -0:30.2 snippets:next-tab-stop (atom-text-editor.editor)
     -0:30.2 snippets:expand (atom-text-editor.editor)
     -0:30.2 editor:indent (atom-text-editor.editor)
     -0:14.5 core:save (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

/cc @atom/core

Copied from original issue: atom/tabs#116

Activity

  1. benogle commented on Feb 5, 2015

    @benogle
    ContributorAuthor

    From @50Wliu on February 5, 2015 12:59

    @iivanovicpu please upgrade to Atom 0.175.0 or above.

  2. benogle commented on Feb 5, 2015

    @benogle
    ContributorAuthor

    He's on 176. Looks like we're still having issues on non-osx when it tries to save files the user doesnt have access to. At least the error message could be legit. But we really should implement the privilege escalation on windows and linux.

  3. benogle commented on Feb 5, 2015

    @benogle
    ContributorAuthor

    My guess on steps to repro:

    1. have etc/hosts open unsaved
    2. Click on the x in the tab
    3. it prompts to save, you choose yes, save
    4. Fail
  4. envygeeks commented on Feb 5, 2015

    @envygeeks
    Contributor

    Define "privilege escalation" on Linux because unless you plan to integrate with polkit I would not recommend you consider "escalating" on Linux because Linux users are well aware of the separation between root and user. That said please do not get crazy on Linux because I do not feel like having to double down on Atom and building profiles to keep it from doing crazy shit like trying to use sudo to write to files because that's a big nono unless it's explicit.

  5. benogle commented on Feb 5, 2015

    @benogle
    ContributorAuthor

    Windows then :)

  6. envygeeks commented on Feb 5, 2015

    @envygeeks
    Contributor

    Might I suggest on Linux just sending out one of those popup warnings like: 'This file is not writeable with your permissions, please launch atom with sudo atom or with the user who owns the file sudo -u user atom /path/to/file'

  7. benogle commented on Feb 5, 2015

    @benogle
    ContributorAuthor

    It does give a similar error in most cases, I'm not sure why it is throwing an error in this case rather than displaying the nicer message.

  8. envygeeks commented on Feb 5, 2015

    @envygeeks
    Contributor

    I also have one last question on this topic: Does atom even isolate the damage a plugin can do to the system? In that does it prevent web access unless a manfest file provides an explicit url and permissions for that URL? Does it do anything to prevent uploading data from a project? Does it limit where and what plugins can even access? Because unless that is the case I wouldn't even bother with any escalation unless you plan to escalate an isolated writer and not the entire application (especially on Linux and OS X.)

  9. thedaniel commented on Feb 5, 2015

    @thedaniel
    Contributor

    @envygeeks #1763 might be of some interest to you. Basically, the answer is "no".

  10. nathansobo commented on Feb 5, 2015

    @nathansobo
    Contributor

    It would be an isolated reader/writer process I think if we did it.

  11. nathansobo commented on Feb 5, 2015

    @nathansobo
    Contributor

    Basically, the answer is "no".

    For now.

  12. self-assigned this
    on Feb 5, 2015
  13. lock commented on Jan 23, 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!

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions