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

Prohibit running under sudo unless explicitly forced to do so #3265

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

peterebden
Copy link
Member

@peterebden peterebden commented Oct 4, 2024

We occasionally see people doing this which frankly messes everything up (they end up with a bunch of files owned by root which can't be removed, which they then complain about later). It's also terrible from a security perspective to invoke a tool like Please as root which will execute a heap of other commands and download files etc.

Sudo sets several env vars, so we can just refuse to run if they are set. I've added a flag to force working around it but I assume this shouldn't be necessary.

I guess you could consider this a breaking change, I'd like to not on the basis that this was a terrible idea all along. We can't have this as a config setting because it's effectively too late (by that point we've already done some stuff, e.g. written a log file)

@peterebden peterebden merged commit 01ff2d5 into thought-machine:master Oct 7, 2024
13 of 14 checks passed
@peterebden peterebden deleted the prohibit-sudo branch October 7, 2024 10:48
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

Successfully merging this pull request may close these issues.

2 participants