-
Notifications
You must be signed in to change notification settings - Fork 18
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
Comments
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. |
It might actually make sense to just skip the modinfo command entirely and just do the lsmod command. |
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. |
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? |
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. |
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.
The text was updated successfully, but these errors were encountered: