ui: don't complain for receivers in other seats

This commit is contained in:
Peter F. Patel-Schneider 2020-05-07 14:47:02 -04:00
parent 97fa7de28a
commit b7e8e646b5
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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)