Why is the ownership for /dev/input/eventX set to "root"?

1

Why are /dev/input/eventX permissions/ownership set to crw-r----- root.root? Then no unprivileged user application can program the mouse.

According to what I've read it's due to security reasons, and I understand this. Yes, I also know that I can change eventX permissions via udev. But /dev/ttyX behavior is different, when not logged in, it is:

crw------- root.root

and once logged in, it becomes:

crw------- francesc.tty

Wouldn't it make sense to do the same for the mouse (/dev/input/whatever)? It seems a design inconsistency to me.

What do you think?

francesc

Posted 2011-09-21T09:40:34.130

Reputation: 21

Answers

0

The mouse is a shared system hardware resource, and a tty is a local resource that a user can temporarily conjure into existence for personal use; I see no reason for the permission models to be similar)

What problem is it you are trying to solve by using the mouse device directly?

Lee Hambley

Posted 2011-09-21T09:40:34.130

Reputation: 301

From a application design point of view I see keyboard (/dev/tty) and mouse (/dev/input/eventX) as equal citizens. I decide to use kbd as main input stream but later I change my mind and decide to use the mouse. Then I've a problem (obviously solvable) because I can open kbd but not mouse.

As a matter of fact, there are well known efforts to run X without setsuid, the how come it is X supposed to open /dev/input/eventX? Does anybody know the answer? – francesc – 2011-09-21T10:10:24.177