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

Dependency/Discussion: remove usage of sudo in scripts/makefiles #182

Open
eyJhb opened this issue Apr 23, 2021 · 5 comments
Open

Dependency/Discussion: remove usage of sudo in scripts/makefiles #182

eyJhb opened this issue Apr 23, 2021 · 5 comments

Comments

@eyJhb
Copy link

eyJhb commented Apr 23, 2021

After reading some PRs, I can see more and more sudo commands getting introduced into the code.
This can be a issue, seeing as more and more people are switching away from sudo and using such things as doas instead.

I propose removing sudo from the code, and making it either configurable with a variable, or telling the user to please run X script as the root user.

If I find the time, I would like to take a stab at this :)

Any comments on this are appreciated!

@crawfxrd
Copy link
Member

After reading some PRs, I can see more and more sudo commands getting introduced into the code.

Such as which ones? I don't see any current PRs adding sudo.

more and more people are switching away from sudo and using such things as doas instead.

Do you have any sources for that?

sudo is a pretty standard tool available on every Linux distro, whereas doas is an OpenBSD tool.

I propose removing sudo from the code

Installing dependencies, accessing certain sysfs values, and LPC/SPI access all require root access to work.

or telling the user to please run X script as the root user.

That would require every script to be run as root instead of only the commands that need root access, and probably breaks deps.sh.

@eyJhb
Copy link
Author

eyJhb commented Apr 23, 2021

After reading some PRs, I can see more and more sudo commands getting introduced into the code.

Such as which ones? I don't see any current PRs adding sudo.

I didn't mention it was open PRs :) - https://github.com/system76/ec/pull/164/files

more and more people are switching away from sudo and using such things as doas instead.

Do you have any sources for that?
sudo is a pretty standard tool available on every Linux distro, whereas doas is an OpenBSD tool.

Faults in sudo keeps popping up, as it is a do-all tool, ie. CVE-2021-3156.
Also, yes sudo is availble on most, but does not imply it is installed, etc.

I propose removing sudo from the code

Installing dependencies, accessing certain sysfs values, and LPC/SPI access all require root access to work.

Yes, that was not what was stated :) you removed and making it either configurable with a variable, which is pretty important.

or telling the user to please run X script as the root user.

That would require every script to be run as root instead of only the commands that need root access, and probably breaks deps.sh.

Then you have left one option left I suppose, ie. and making it either configurable with a variable.

There is a total of 26 occurences of sudo in the current files.

This might be wishful thinking to remove/replace, but would be quite nice.

@crawfxrd
Copy link
Member

you removed "and making it either configurable with a variable", which is pretty important.

I am simply dismissing the option of being able to remove the use of sudo entirely.

Then you have left one option left I suppose, ie. and making it either configurable with a variable.

Yes. This is the only way it would make sense.

But, again, doas is an OpenBSD tool. (And I don't expect OpenBSD devs are the ones maintaining the Linux fork.) How many people use it? What value is there to maintain compatibility with it?

@eyJhb
Copy link
Author

eyJhb commented Apr 27, 2021

I am simply dismissing the option of being able to remove the use of sudo entirely.
I was never saying that as a option, but maybe the comma made it seem like that. Sorry :)

But, again, doas is an OpenBSD tool. (And I don't expect OpenBSD devs are the ones maintaining the Linux fork.) How many people use it? What value is there to maintain compatibility with it?

Not sure how many have switched, since I guess it is not that easy on most distros.
I am running NixOS which makes it quite easy to do this.

However, this is only a suggestion and a nice-to-have thing, and shouldn't be a priority :)
Guessing it could be a nice "first-issue" for somebody to pick up. :)

@ids1024
Copy link
Member

ids1024 commented Apr 27, 2021

I suppose in Makefiles it's easy enough to have SUDO := sudo so a different command can be passed as an argument. Not sure about shell scripts.

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

3 participants