# Wrong device permissions

## V10lator

First let me tell you a bit so you better understand the problem:

Some time ago I changed from openRC to systemD. Before you ask: No, I won't change back.

Now I got a new gamepad, connected it and... experienced wrong permissions of device nodes. According to this thread I have to be in the uinput group, but that's wrong/outdated, the device is made for root:root with 600:

```
$ ls -l /dev/uinput

crw------- 1 root root 10, 223 21. Feb 08:23 /dev/uinput
```

Looking at udev rules it should be 640:

```
$ grep uinput /lib/udev/rules.d/*

/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", MODE="0640"
```

But this is still wrong, I have to change it to 666 to be able to run xboxdrv as a regular user (being in the uinput group). Of course I have to do this after every reboot.

If you think that's all you are wrong. After starting xboxdrv I need to change two more permissions before I can use the device: /dev/input/event6 (for force-feedback) and /dev/input/js0:

```
$ ls -l /dev/input/event6 /dev/input/js0

crw-r----- 1 root root 13, 70 21. Feb 08:44 /dev/input/event6

crw-r--r-- 1 root root 13,  0 21. Feb 08:44 /dev/input/js0
```

At least they are what udev rules tell they should be:

```
$ grep event /lib/udev/rules.d/* | grep MODE

/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="input", KERNEL=="mouse*|mice|event*", MODE="0640"

$ grep js /lib/udev/rules.d/* | grep MODE

/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0644"
```

Now I wonder if the problem is in udev, ConsoleKit or systemD. Please help.

----------

## ulenrich

 *V10lator wrote:*   

> I have to do this after every reboot.

 Why don't you

cp /lib/udev/rules.d/50-udev-default.rules /etc/udev/rules.d/50-udev-default.rules

edit /etc/udev/rules.d/50-udev-default.rules

You own rules file at /etc/udev/rules.d should over rule the distribution rules file as long as it has the exact same name. That is what /etc is about: Its your root-administrator playground.

----------

## V10lator

And what exactly to change there when it seems to get ignored anyway?

//EDIT: Just to confirm that it's ignored I did what you told and changed the input handling:

```
# input

SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"

SUBSYSTEM=="input", KERNEL=="mouse*|mice", MODE="0640"

SUBSYSTEM=="input", KERNEL=="event*", MODE="0666"

SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", GROUP="uinput", MODE="0660"

SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0666"
```

Curiously the uinput change is ignored:

```
$ ls -l /dev/uinput

crw------- 1 root root 10, 223 21. Feb 14:57 /dev/uinput
```

While the event/js change seems to work:

```
$ ls -l /dev/input/event6 /dev/input/js0

crw-rw-rw- 1 root root 13, 70 21. Feb 15:00 /dev/input/event6

crw-rw-rw- 1 root root 13,  0 21. Feb 15:00 /dev/input/js0
```

Last edited by V10lator on Thu Feb 21, 2013 2:01 pm; edited 1 time in total

----------

## PaulBredbury

So create a udev rule that works. Google "udev debugging".

To get you started:

```
udevadm info -a --name /dev/uinput
```

----------

## V10lator

 *PaulBredbury wrote:*   

> To get you started:
> 
> ```
> udevadm info -a --name /dev/uinput
> ```
> ...

 

Thanks a lot! /dev/uinput is a subsystem of misc, not input. That fixed it!  :Very Happy: 

I guess this is a bug, but is it a gentoo or upstream bug? Also I'm curious if there are better solutions available and/or if the whole thing is a bug (a joystick should work out of the box, shouldn't it?).

----------

## ulenrich

If you get help you are supposed to help:

https://bugs.gentoo.org

... if you have reason to think you have found a bug.

Developers are not that often gamers. Joysticks might have been forgotten at some point ...

----------

## V10lator

 *ulenrich wrote:*   

> If you get help you are supposed to help

 

Sure, but I don't want to annoy gentoo devs with upstream bugs, that's why I asked if anybody knows if this is a gentoo or a upstream bug.  :Smile: 

----------

