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

Root privileges works, changing group doesn't? #18

Closed
solomongrundy6 opened this issue May 31, 2024 · 2 comments
Closed

Root privileges works, changing group doesn't? #18

solomongrundy6 opened this issue May 31, 2024 · 2 comments
Assignees

Comments

@solomongrundy6
Copy link

I've been using this for a project of mine and everything works as expected if I run it with sudo. In another issue, you mentioned that adding your user to the groups 'input' and 'plugdev' would allow you to run without root privileges, but this doesn't seem to work for me, I always get the error "Must be run as root". Is there something else to it that I'm not aware of? The device I'm trying to access seems properly permissioned (has read/write enabled for group input, which I'm a member of).

@MarinX
Copy link
Owner

MarinX commented Jun 4, 2024

Looks like the issue is here

The better way would be to check if the os.Open fails and if it's a permission problem, check if the user is root and give a solution.

Let me fix that with a PR

@MarinX MarinX self-assigned this Jun 4, 2024
MarinX added a commit that referenced this issue Jun 4, 2024
Dont check for sudo first, try to open fd
@MarinX
Copy link
Owner

MarinX commented Jun 4, 2024

pushed the fix with test, please check now and let me know.
Closing the issue.

@MarinX MarinX closed this as completed Jun 4, 2024
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