mouse icon indicating copy to clipboard operation
mouse copied to clipboard

Allow non-root users of appropriate groups to use module in Linux

Open linux-man opened this issue 4 years ago • 4 comments

Fortunately, this can be easily achieved by replacing _nixcommon.py with the more updated keyboard/_nixcommon.py version, and removing "ensure_root" from _nixmouse.py.

linux-man avatar Dec 08 '21 23:12 linux-man

Yes, please change this.

Checking that the current user is uid = 0 is unnecessary, wrong, and harmful.

Unnecessary, because if the current user doesn't have the required permission, we'll get a runtime error anyway.

Wrong, because what we're interested in is not the UID, but whether the user has access to those input files.

Harmful, because it incentivizes running user programs as root. The kind of programs that you would write with this package should not typically be run as root.

tdammers avatar Feb 11 '22 20:02 tdammers

This is a duplicate of https://github.com/boppreh/mouse/issues/78

adabru avatar Jul 13 '22 20:07 adabru

@linux-man Do you think you have a working solution that could be PRd? This would be extremely useful in https://github.com/boppreh/keyboard as well. For example: https://github.com/boppreh/keyboard/issues/420

Avasam avatar Jul 19 '22 23:07 Avasam

I implemented the changes I mentioned. You can find them at https://github.com/linux-man/inmon. Since I'm only using for catching events and it's not extensively tested, I didn't PRd.

linux-man avatar Jul 28 '22 10:07 linux-man