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

DocPad should exit when (1) used with sudo (2) when sudo is required #1009

Open
balupton opened this issue Sep 4, 2015 · 2 comments
Open

Comments

@balupton
Copy link
Member

balupton commented Sep 4, 2015

One of the most common issues that people run into with DocPad as well as other node modules is permission errors due to incorrectly configuration installations of node. If people are using DocPad with sudo then we should error and tell them no. If people are using DocPad and permissions aren't set correctly, we should also exit and tell them no.

Besides the usual permission errors, here are some other issues caused by sudo and incorrect permissions:

@balupton
Copy link
Member Author

balupton commented Sep 8, 2018

Anyone have any idea how to detect if sudo is being used?

@balupton balupton modified the milestones: Essential, Nice to have Sep 8, 2018
@jrbart
Copy link

jrbart commented Oct 23, 2018

You can check for the SUDO_USER environment variable, but that can be tampered with.

But, if you check "getuid" and see that you are root, wouldn't you want to bail out no matter how you got there (setuid, sudo, root login...)? You might also compare real and effective uids and bail out if they are not the same, or if they are a system user.

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

No branches or pull requests

2 participants