From b7e8e646b5eee6785590ab35d3212415ece8b36f Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 7 May 2020 14:47:02 -0400 Subject: [PATCH] ui: don't complain for receivers in other seats --- ChangeLog | 3 +++ lib/solaar/listener.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0cab1464..541de069 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +New: + * Don't complain for receivers that are for other seats + 1.0.2rc2: * Remove packaging directory tree as it is not maintained * Pip installs udev rule and solaar autostart when doing install without --user flag diff --git a/lib/solaar/listener.py b/lib/solaar/listener.py index f75dccb3..a240e4de 100644 --- a/lib/solaar/listener.py +++ b/lib/solaar/listener.py @@ -343,4 +343,13 @@ def _process_receiver_event(action, device_info): _start(device_info) except OSError: # permission error, ignore this path for now - _error_callback('permissions', device_info.path) + # If receiver has extended ACL but not writable then it is for another seat. + # (It would be easier to use pylibacl but adding the pylibacl dependencies + # for this special case is not good.) + try: + import subprocess, re + output = subprocess.check_output(['/usr/bin/getfacl', '-p', device_info.path]) + if not re.search(b'user:.+:',output) : + _error_callback('permissions', device_info.path) + except: + _error_callback('permissions', device_info.path)