-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Permission of /tmp/.ydotool_socket is too restricted #73
Comments
Run ydotool each time with |
It makes ydotool a bit useless if I need to type it with sudo each time (my main use case is use it with I don't think it could cause security issues by just allowing the members of the group to read and write to the file, if it's dangerous then such udev rules is also dangerous because it simply let the user of the |
I second @dashezup opinion. A reasonable thing would be to make the group owner of the socket the |
No need to specify owner and group of the socket file in source code, service managers should be able to do that (by setuid and setgid before run it). I use a custom udev rule to allow users in But ydotool always create socket file in 600 permission I can do anything with uinput anyway, run ydotoold with my current user and I will be able to access the socket file (since the ower and group will be my user/group). Specifying group permission is not dangerous, just don't give permission to "other users" (the third permission triad). Permission 660 is fine. |
If you really think 660 could cause security issues, the ideal solution would be check permission of |
@dashezup you can just do |
I wrote a full tutorial where I show how to start the daemon in such a way that sudo is never needed to run the main tool, by letting the user own the socket file. The daemon allows setting the permissions and ownership as you start it. Full details on my personal website here: https://gabrielstaples.com/ydotool-tutorial/#gsc.tab=0 See #207 (comment) |
In order to access
/dev/uinput
, I added the udev rules to allow users ofinput
group to access to itKERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
And I have a system service to run
ydotoold
(with setuidroot
and setgidinput
), it creates/tmp/.ydotool_socket
with permission 600The problem is my user can't read or write to the socket file so it still can't connect to the backend, even though my user is in the input group. seems the permission of the socket file should be at least 660 to allow the user in the group to access it.
One of the solution is let the service run ydotoold with my uid and gid
input
, so the.ydotool_socket
's ower will be my user. ButThe better solution is creating a folder in /tmp and save socket file inside it, I saw it was mentioned in an answer on stackoverflow.
I'm using ydotool on Void Linux (the init system is runit), but I guess this issue should also present in systemd distros? How do they use ydotoold service? Run it as a user service?
Run it as a user service does not work here with runit, because I need to set the gid to
input
toydotoold
binary. Although run ydotoold from CLI works.The text was updated successfully, but these errors were encountered: