You are not logged in.

#1 2020-05-14 17:00:47

Komisch
Member
Registered: 2018-05-30
Posts: 45

Allow application access to a device

Greetings Community,

I would like to know how I can grant some application access to a certain device? I just received my MX Master 3 and connected it via Bluetooth to my PC which so far works well. Now I also installed logid which delivers device support features. When I now start logid it puts out the warning "Failed to open /dev/hidraw0: open: Permission denied" which is my bluetooth device.

My problem is, that I don't know how I grant access to the device and what exactly is the one I address with the access? I know there are users and groups and for myself I am able to grant at least access to files and change permissions of them. But granting an application access to something and addressing the application correctly is something I am not aware of.

Offline

#2 2020-05-14 17:18:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,519
Website

Re: Allow application access to a device

The program runs as your user:group, so you just need for your user to have the appropriate permissions for the device.

Ideally this is done by adding yourself to the appropriate group: what is the default permission/ownership of /dev/hidraw0?

If this is not an option, you can use a udev rule to change the permissions/ownership of /dev/hidraw0 appropriately.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-05-14 17:26:30

Komisch
Member
Registered: 2018-05-30
Posts: 45

Re: Allow application access to a device

Hi Trilby,

Ideally this is done by adding yourself to the appropriate group: what is the default permission/ownership of /dev/hidraw0?

Is there a way to determine this? Is it put into some group by default?

Offline

#4 2020-05-14 17:45:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,819

Re: Allow application access to a device

stat /dev/hidraw0

Offline

#5 2020-05-14 18:05:46

Komisch
Member
Registered: 2018-05-30
Posts: 45

Re: Allow application access to a device

Thank you.

the output:

  File: /dev/hidraw0
  Size: 0             Blocks: 0          IO Block: 4096   character special file
Device: 6h/6d    Inode: 1400115     Links: 1     Device type: ed,0
Access: (0600/crw-------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-05-14 18:50:49.542881834 +0200
Modify: 2020-05-14 18:50:49.542881834 +0200
Change: 2020-05-14 18:50:49.542881834 +0200
Birth: -


Seems not to contain a group which probably means it is in no group yet.

So I most likely have to go with the udev rule. Where should I place such a rule and how will it look like?

I will try to follow this guide: https://www.thegeekdiary.com/beginners- … -in-linux/ but maybe you can help me with that too?

Offline

#6 2020-05-14 18:14:23

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,819

Re: Allow application access to a device

No. It belongs to user and group "root". You *don't* want to add your regular user to the root group, so yes: you want to alter the file permissions through a udev rule.

And no, you will follow this guide: https://wiki.archlinux.org/index.php/Udev

If you've questions regarding any step, feel free to ask back.

Offline

Board footer

Powered by FluxBB