CWiid Version 0.6.00 unable to open uinput

Bug #312957 reported by ethana2
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
cwiid (Ubuntu)
Confirmed
High
Unassigned

Bug Description

ethan@home:~$ sudo rmmod uinput
ethan@home:~$ sudo modprobe uinput
ethan@home:~$ wminput
unable to open uinput
ethan@home:~$ wminput -v
CWiid Version 0.6.00

If anyone has had any success with wminput on Ubuntu 8.10, at all, please let me know.

Revision history for this message
Justin Dugger (jldugger) wrote :

This is probably due to permissions. uinput can listen and inject keystrokes, so by default it's restricted to root.

The manpage has a few suggestions on how to work around this; try "sudo wminput" and see if it still errors out.

If sudo fails, can you attach the output of "lsmod"?

Changed in cwiid:
status: New → Incomplete
Revision history for this message
ethana2 (ethana2) wrote : Re: [Bug 312957] Re: CWiid Version 0.6.00 unable to open uinput

Ok, it works with sudo. Now, how do I use it without sudo, like groups and
all that?
--also, if you could help me so I don't have to run xsane as root to scan
things in, I would appreciate that immensely as well.

Revision history for this message
Justin Dugger (jldugger) wrote :

From man wminput:

"Place the following line in a file in /etc/udev/rules.d (see the documentation for your distro for the recommended file for local rules) to allow anyone on the system to use uinput:

       KERNEL=="uinput", MODE="0666"

A more secure method uses the following line to allow anyone in <group> to use wminput, and adds only the desired users to <group>:

       KERNEL=="uinput", GROUP="<group>"

A uinput group can be created specifically for this purpose, or another existing group such as wheel can be used."

In this case, something like /etc/udev/rules.d/50-wminput.rules should work. In the past I've looked for Debian policy on what group would be appropriate here without much success. You could just make a new one and add yourself, via the Uses & Groups tool.

Revision history for this message
Justin Dugger (jldugger) wrote :

Known behavior with no good solution at the moment. Closing bug.

Changed in cwiid (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Scott Kitterman (kitterman) wrote :

How does "we don't know how to fix it" make the bug invalid?

Revision history for this message
ethana2 (ethana2) wrote :

Funny, I would have been fine with 'input insertion SHOULD require
root privileges for security reasons' or something like that, but I'm
going to have to go with Scott's rhetorical question on this.

Revision history for this message
Justin Dugger (jldugger) wrote :

You're right, that was undiplomatically stated. uinput insertion SHOULD require root privs. Fundamentally, this is insecure and automatically adding users to groups and so on doesn't change this. Short of finding a way to remove uinput requirements, there's no way to secure this app.

https://bugs.launchpad.net/ubuntu/+source/cwiid/+bug/140890 contains more discussion from core developers on the subject. I have no idea how to triage this in light of this situation.

Revision history for this message
Scott Kitterman (kitterman) wrote :

I think this is appropriate. It does sound like one should expect this to get fixed anytime soon, but the bug seems valid, confirmed, and an imporant one for the package.

Changed in cwiid:
importance: Undecided → High
status: Invalid → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

should/should not expect ...

Revision history for this message
Zugol (franck-jeandinot) wrote :

It seems that the rules editing workaround doesn't work anymore in ubuntu 9.10 karmic koala...

Even with adding these two rows :
   KERNEL=="uinput", MODE="0666"
   KERNEL=="uinput", GROUP="<group>"
uinput has only these rights :
   crw-r-----

Revision history for this message
Danny (dannyjordan-91) wrote :

I was able to fix this in Ubuntu Karmic Koala 9.10.

What I did was went to the directory

/etc/udev/rules.d/

And looked at what files were there one was

70-net.rules

So when I created my wminput rules I went to terminal and typed sudo gedit then when it opens you have root control then you type either one of these

KERNEL=="uinput", MODE="0666"

KERNEL=="uinput", GROUP="<group>"

It doesn't make either but where group is be sure to put a group then save it in

/etc/udev/rules.d/

Then save it as what ever the first number on one of the files that was already in there was then -wminput.rules

Example

70-net.rules

You would have to save it as

70-wminput.rules

Hope this helps you guys it worked for me and it has been like awhile and it is still working but you have to follow the step or you can't save it because of file permissions.

have any questions post them.

Revision history for this message
Danny (dannyjordan-91) wrote :

Also I can only assume that the same principle would apply to other versions like if you were running it one 9.04
I also have cWiid 6.00

Revision history for this message
gfnord (gfnord) wrote :

I tried Danny's instructions in Lucid Lynx 10.04 and they doesn't work. wminput still needs sudo to run.

Revision history for this message
Arturo Torres Sánchez (r2d2.art2005) wrote :

@gfnord Danny's solution worked for me in Lucid. You also have to "sudo modprobe uinput" or add it in /etc/modules.

Which other rules do you have in /etc/udev/rules.d/ ?

Revision history for this message
gfnord (gfnord) wrote :

@Arturo

I have several other rules in there, the one with the lowest number is called 45-<something>.rules, so I named mine 45-wminput.rules. After this wminput still needed to be run with sudo.

Eventually, I "fixed" this by editing sudoers and allowing there for wmimput to run with sudo without asking the password.

Revision history for this message
Arturo Torres Sánchez (r2d2.art2005) wrote :

I believe you should use the highest number of the rules, not the lowest. In Karmic I had rules with 45-*.rules and 70-*.rules. When I created a 45-wminput.rules nothing changed, but using 70-wminput.rules fixed the problem.

But now, I'm on Lucid and I just have one rule before adding wminput, so I can't really tell if that works on Lucid.

Revision history for this message
Mik (lebohec) wrote :

In order to work whatever the rule number you choose you could use the ":=" operator :

KERNEL=="uinput", MODE:="0666"

For an explanation read "man 7 udev" :

       :=
           Assign a value to a key finally; disallow any later changes, which
           may be used to prevent changes by any later rules.

Revision history for this message
reitzmichnicht (reitzmichnicht) wrote :

The default permission restriction for /dev/uinput also affects AVRCP devices connected via bluetooth to control the a2dp signal.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.