Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

giving a user permission to read evdev device output [SOLVD]

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

giving a user permission to read evdev device output [SOLVD]

  • Quote

Post by mikegpitt » Wed Mar 10, 2010 5:56 pm

I'm working on a small program that requires regular users to read output from evdev generated devices (e.g /dev/input/event1). Everything works fine as root or if I run the program using sudo, but when I run as a user I get "evdev open: Permission denied".

I'm guessing this must have something to do with hal or udev permissions, but am not sure how to properly add the rule needed.

Can someone point me in the right direction of where and how I would add a rule to give users access to the device? Thanks!
Last edited by mikegpitt on Wed Mar 10, 2010 7:23 pm, edited 1 time in total.
Top
gentoo_ram
Guru
Guru
Posts: 528
Joined: Thu Oct 25, 2007 10:04 pm
Location: San Diego, California USA

  • Quote

Post by gentoo_ram » Wed Mar 10, 2010 6:12 pm

Here's a rule I have for my Wireless headset volume button:

Code: Select all

KERNEL=="event*",       NAME="input/%k", ATTRS{name}=="Plantronics Plantronics Headset", MODE="0640", GROUP="event", SYMLINK+="input/headset"
That changes the permissions to 0640 and sets the group to "event" and my user is in that group. You can tweak it to your hearts content. I put this in /etc/udev/rules.d/10-my-udev.rules. It even makes a symbolic link so you don't have to guess which "eventxx" device it is.
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Wed Mar 10, 2010 7:22 pm

Thanks! That worked like a charm. Instead of the name parameter I ended up using the hid param, so my rule looks like this:

Code: Select all

KERNEL=="event*",  SUBSYSTEM=="input", ATTRS{hid}=="MYDEV000", MODE="0644", GROUP="event", SYMLINK+="input/mydevice"
BTW - For anyone reading this thread, I also found a nice command to output all udev parameters for any device (substitute for any device under /dev):

Code: Select all

udevadm info -a -p  $(udevadm info -q path -n /dev/input/event1)
Top
Post Reply

3 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic