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

Requires sudo on Debian #90

Open
davidheitman opened this issue Nov 18, 2023 · 5 comments
Open

Requires sudo on Debian #90

davidheitman opened this issue Nov 18, 2023 · 5 comments

Comments

@davidheitman
Copy link

Because this spawns a subprocess that calls modinfo, it must be run as root (on Debian bookworm, anyway, and probably other distros where modinfo requires root). This is problematic from a security perspective, and inconvenient from a user perspective. Would be nice to have a flag that skips module checks so as to not have to run as root. Make it an advanced option for those who are confident the proper modules are loaded.

@davidheitman
Copy link
Author

I can throw together a quick PR for this over the weekend, nothing but some argparse and a conditional. But for tonight, it is late and I am tired.

@davidheitman
Copy link
Author

It might actually make sense to just skip the modinfo command entirely and just do the lsmod command.

@davidheitman
Copy link
Author

OK, correction. It's not that modinfo requires root. It can be run as a normal user. But by default it's not in a non-root user's PATH (it's in /usr/sbin on Debian), hence the not found issue when run as a non root user. So this would work with an absolute path of /usr/sbin/modinfo.

@davidheitman
Copy link
Author

OK, I think this will need some distro specific pathing. On debian and similar, modinfo is under /usr/sbin, and lsmod is under /usr/bin. So lsmod is in non-root users' PATH, but modinfo is not. On Fedora and similar, both modinfo and lsmod are under /usr/sbin, and so not in a non-root user's PATH.

I'm curious, what distro do you use for your dev env?

@joaorb64
Copy link
Owner

Sorry for not replying earlier! I'm away from this project for quite a while now, but I can take a look and get back to you.
I belive I was using sudo on my Ubuntu, but I'll really have to check.
Also now with python being more strict about environments I think the program flow needs some adjustments, too.

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

2 participants