Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify "Launching as sudo" #292

Closed
bpasero opened this issue May 2, 2016 · 6 comments
Closed

Clarify "Launching as sudo" #292

bpasero opened this issue May 2, 2016 · 6 comments
Assignees

Comments

@bpasero
Copy link
Member

bpasero commented May 2, 2016

@joaomoreno @Tyriar @gregvanl fyi

I find https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/latest.md#run-vs-code-using-sudo a bit weird because it explicitly says how to launch on Mac OS X as sudo, though if you do that you get a message right inside the workbench telling you that it is not recommended to launch VS Code as sudo.

If that is true, we should not advertise how to run with sudo on Mac OS. Not sure about Linux.

@joaomoreno
Copy link
Member

It is not recommended to do so, but you can still use it at your own risk. It's the only way you can edit root-owned files, for example. We should just provide functionality within the workbench to escalate privileges in order to save said files... but for now, this is it. Leaving it to you for comments @Tyriar

@Tyriar
Copy link
Member

Tyriar commented May 3, 2016

The fix I did was making it not crash so that vscode can edit these files. You actually can't edit user-owned files when running as sudo which isn't too big of an issue imo as using sudo code exclusively would mess up file permissions.

The ideal behavior we should strive for is popping up an admin dialog when there are no write permissions for the current user. I think Sublime does this.

@Tyriar
Copy link
Member

Tyriar commented May 3, 2016

The reason it's in the notes is because people were asking for it, and it was impossible to edit root-owned files with vscode, forcing people to fallback on other editors. microsoft/vscode#3068

@joaomoreno feel free to change if you disagree, I'll be out for another week or so.

@Tyriar Tyriar assigned joaomoreno and unassigned Tyriar May 3, 2016
@bpasero bpasero assigned Tyriar and unassigned joaomoreno May 3, 2016
@bpasero
Copy link
Member Author

bpasero commented May 3, 2016

@Tyriar I talked to @joaomoreno about this today and there are some concerns we have. For one, we do not recommend to run as sudo user for several reasons (files you create are owned by sudo, your data directory would be potentially created as sudo user, etc.). As such, we think you should not explicitly shout out about support for running as sudo at all.

Then, you advertise the user-data-dir option. I wonder if we should really do that, because reality is that there are more data directories where stuff is put (e.g. extensions) and people might misinterpret this option as a way to have portable VS Code.

Finally, wouldn't it make more sense to automatically change the user-data-dir when we detect that VS Code is being run as sudo? Why would a user have to explicitly change the user-data-dir in that condition?

@gregvanl
Copy link

gregvanl commented May 6, 2016

I've remove this section from the releasenotes for the 1.1 release. Once Dan is back, he can weigh in if he'd like to add back some portion of that section.

@Tyriar
Copy link
Member

Tyriar commented May 11, 2016

@bpasero yes the user data dir will automatically be set eventually, it didn't make it in for April microsoft/vscode#5570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants