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.
This commit is contained in:
parent
9da66068dc
commit
2568a295b6
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue