houmain / keymapper

A cross-platform context-aware key remapper.
GNU General Public License v3.0
257 stars 21 forks source link

why are there 2 exefiles #117

Closed kbilsted closed 3 months ago

kbilsted commented 3 months ago

what is the reasoning behind having both keymapper.exe and keymapperd.exe

I ask because when using the keymapper at a workplace I can imagine many places where if you install a keylogging service that also opens a port for remote control, can be hard to argue for. A scan toolk can easily identify it as a trojan program and you'd have to argue for scan policy changes etc etc

since im not sure what the kind of traffic is betwen the two executables are, Im not sure if it makes sense to suggest an argument to disable port listening, which then may lead to a more restricted user experience. Perhaps all errors are just in a logfile rather than a notification, perhaps you cannot pause the service only kill it etc etc

houmain commented 3 months ago

The main motivation for two executables was that:

So for security and simplicity reasons these tasks are executed by separate processes running with the required permissions. The communication between these processes is kept as minimal as possible. keymapper just informs keymapperd about the configuration and the focused window. keymapperd informs keymapper about the terminal command to execute. For this only a few indices are transferred. Key presses are never transferred. Furthermore Unix domain sockets are used for the interprocess communication (even on Windows), so this does not need any opened ports and allows only communication between processes on the same machine.

kbilsted commented 3 months ago

But since both processes are needed how is this safer than if it was one process only

houmain commented 3 months ago

Because the critical part, the process with the elevated privileges only does what it really has to do. It does not read some file from the filesystem and does not launch processes, which would also have elevated privileges. Also simplicity was a motivation. On Linux and MacOS the daemons are strictly separated from the GUI and cannot simply determine which window some user has focused.

kbilsted commented 3 months ago

Ok many thanks. Consider adding your explanation to the readme. It explains a lot. I can also do it as a PR if you wish