-
Notifications
You must be signed in to change notification settings - Fork 26
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
systemctl --user service #10
Comments
Hi there! Yes, I've already thought about the possibility to run sidewinderd as a non-root user. However, giving non-root users access to If for some reason a malicious game / software is beeing run by We could fix this e.g. by creating a dedicated user Either way, I will make sure that sidewinderd doesn't get in the way, if users want to setup udev rules and run sidewinderd as a non-root user. About the daemon specific code: actually, it's there, but it's not beeing used in a systemd environment. Please note, that I've added Thank you for your input! Cheers, |
Yeah, I just noticed that. So theoretically one could simply make a user unit and run it with that without any particular changes to the code itself, no? |
Currently, in some parts of the code, In your theoretical scenario, So, I'm not entirely sure about it, but my wild guess is, it probably would work out-of-the-box. I can't try it out myself, as I don't have access to my Linux machine atm. |
true... in which case, why not just remove the |
It's common practice to only elevate privileges when needed, like opening a file with root permissions etc. The goal is to run the program with the least possible privileges. Current design: you define a Of course, if you set But I agree, there is no need for About the PID-file: http://stackoverflow.com/a/5174433. It seems to be common practice to put PID-files in |
There is also the option to set the |
Something like |
Brainstormed about this: Similar to libvirtd, I want to implement system- and session-mode. system-mode is basically our current solution - running sidewinderd, when the system boots up and use a single configuration. This is okay for single-user systems, but may not be optimal for multi-user systems. However, for Let's talk about system-mode first: It was a bit difficult to think about a good solution - in terms of usability and security. But I think the following is the best solution so far: on most distros, there is a default group called session-mode: this is a mode, where the daemon fires up as soon as the user logs in (as logged in user). This has some advantages: if your harddrive is encrypted, we don't need to hack around it anymore - the daemon gets started at the correct moment. Every user can have it's own configuration and set of macros. Also, we don't need to run the program as root. However, this solution also has it's downsides: we need to run sidewinderd as the logged in user and therefore grant access to input devices to the users. This opens up a security hole, where browser / office plugins / scripts, which are run as the logged in user, can access input devices. We can avoid this by starting sidewinderd as |
For session-mode you could have a master and slave setup, where master is running as |
Greetings.
First off, let me thank you for inventing the wheel I was contemplating first, and a very good wheel it is.
With that out of the way, have you considered the possibility of allowing this to be ran as non-root via systemd, eg,
systemct --user start sidewinderd.service
orsystemctl --user enable sidewinderd.service
?This would require some fairly trivial changes to the code and the use of udev rules to allow reading and writing
/dev/uinput
and/dev/input/event*
nodes. Basically you'd remove all the daemon specific code and the seteuid type stuffs and treat it as a normal foreground process, letting systemd itself handle the daemon stuffs.The text was updated successfully, but these errors were encountered: