From 2568a295b684ddc40644a1697c3ceea7003a5440 Mon Sep 17 00:00:00 2001 From: Nick Price Date: Sat, 11 Jul 2026 17:43:14 -0700 Subject: [PATCH] listener: -p is a Linux-only getfacl flag FreeBSD's getfacl(1) has no -p, so the call fails and the permission diagnostic that EACCES is supposed to print is swallowed by the enclosing except. Pass -p only where it exists. --- lib/solaar/listener.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/solaar/listener.py b/lib/solaar/listener.py index f09a9f18..7d515dc9 100644 --- a/lib/solaar/listener.py +++ b/lib/solaar/listener.py @@ -19,6 +19,7 @@ from __future__ import annotations import errno import logging +import platform import subprocess import time import typing @@ -472,7 +473,9 @@ def _process_add(device_info: DeviceInfo, retry): except OSError as e: if e.errno == errno.EACCES: try: - output = subprocess.check_output(["getfacl", "-p", device_info.path], text=True) + # -p (don't strip leading '/') is a Linux getfacl extension + getfacl = ["getfacl", "-p"] if platform.system() == "Linux" else ["getfacl"] + output = subprocess.check_output([*getfacl, device_info.path], text=True) logger.warning("Missing permissions on %s\n%s.", device_info.path, output) except Exception: pass