Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] evtest behave differently on two pc's

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
peer
Posts: 459
Joined: 2017-03-26 10:14
Has thanked: 9 times
Been thanked: 22 times

[Solved] evtest behave differently on two pc's

#1 Post by peer »

pc1: Debian 12 Bookworm KDE X
pc2: Debian 12 Bookworm KDE Wayland

The output of the command evtest (owner root) is different on both pc's
pc1:

Code: Select all

evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:      AT Translated Set 2 keyboard
/dev/input/event1:      Power Button
/dev/input/event10:     HUION 256C PEN STYLUS
/dev/input/event11:     RFID Reader RFID Reader
/dev/input/event12:     RFID Reader RFID Reader Keyboard
/dev/input/event14:     HDA ATI HDMI HDMI/DP,pcm=3
/dev/input/event15:     HDA ATI HDMI HDMI/DP,pcm=7
/dev/input/event16:     HDA ATI HDMI HDMI/DP,pcm=8
/dev/input/event17:     HDA ATI HDMI HDMI/DP,pcm=9
/dev/input/event18:     HDA ATI HDMI HDMI/DP,pcm=10
/dev/input/event19:     HDA ATI HDMI HDMI/DP,pcm=11
/dev/input/event2:      Power Button
/dev/input/event20:     HDA Digital PCBeep
/dev/input/event21:     HDA Intel PCH Front Mic
/dev/input/event22:     HDA Intel PCH Rear Mic
/dev/input/event23:     HDA Intel PCH Line
/dev/input/event24:     HDA Intel PCH Line Out
/dev/input/event25:     HDA Intel PCH Front Headphone
/dev/input/event26:     Huion Tablet
/dev/input/event27:     Huion Tablet
/dev/input/event29:     Huion keyboard
/dev/input/event3:      YICHIP Wireless Device
/dev/input/event30:     Huion mouse
/dev/input/event4:      YICHIP Wireless Device Mouse
/dev/input/event5:      YICHIP Wireless Device System Control
/dev/input/event6:      PC Speaker
/dev/input/event7:      YICHIP Wireless Device Consumer Control
/dev/input/event8:      HUION Huion Tablet_H640P Keyboard
/dev/input/event9:      Logitech USB Trackball
Select the device event number [0-30]: 
pc2:

Code: Select all

evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
Select the device event number [0-30]: 
On pc1 the devices are shown and I can execute the command without root
On pc2 the devices are not shown and I cannot execute the command without root

groupinf0:
pc1:

Code: Select all

groups
peer disk cdrom floppy sudo audio dip video plugdev input kvm netdev bluetooth lpadmin scanner libvirt libvirt-qemu
pc2:

Code: Select all

groups
peer cdrom floppy sudo audio dip video plugdev users netdev bluetooth lpadmin scanner
After this I added the group 'input' on pc2 and now the command evtest works also without on pc2.

My question:
When I look at the properties of the file evtest I see that the owner is 'root' and the group is 'root'. But members of the group 'input' also can execute the command without sudo. I discovered this by trial and error. How can I find which groups are able to execute the command (evtest) without sudo????
Last edited by peer on 2024-04-23 13:39, edited 1 time in total.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 735
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 67 times
Been thanked: 173 times

Re: evtest behave differently on two pc's

#2 Post by fabien »

Hello,
peer wrote: 2024-04-23 07:36 When I look at the properties of the file evtest I see that the owner is 'root' and the group is 'root'.
I assume you mean the executable /usr/bin/evtest
The permissions of this file should be rwxr-xr-x (755) which means executable by anyone.
peer wrote: 2024-04-23 07:36 But members of the group 'input' also can execute the command without sudo. I discovered this by trial and error. How can I find which groups are able to execute the command (evtest) without sudo????
According to evtest's manual
man 1 evtest wrote:The output of evtest shows the information presented by the kernel
namely in /dev/input/
and
man 1 evtest wrote:evtest needs to be able to read from the device; in most cases this means it must be run as root.
However, files in /dev/input/ belong to root/input with permissions 660, e.g.

Code: Select all

$> ls -l /dev/input/event1
crw-rw---- 1 root input 13, 65 Apr 23 12:11 /dev/input/event1
and are therefore readable (and writable) by user root or group input. If your user is in the input group, evtest is “able to read from the device”.

Code: Select all

$> find /dev/ -group "input"
will show you all these files.

May also be relevant:
man 1 evtest wrote:If evtest does not show any events even though the device is being used, the device may be grabbed by a process (EVIOCGRAB). This is usually the case when debugging a synaptics device from
within X. VT switching to a TTY or shutting down the X server terminates this grab and synaptics devices can be debugged.

The following command shows the processes with an open file descriptor on the device:

fuser -v /dev/input/eventX
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

peer
Posts: 459
Joined: 2017-03-26 10:14
Has thanked: 9 times
Been thanked: 22 times

Re: evtest behave differently on two pc's

#3 Post by peer »

Yes, it has to do with the event files in /dev/input/
They have as owner: root and as group: input

Post Reply