mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Make sure to handle symlinks when fetching logfiles
This commit is contained in:
parent
f25e07fd82
commit
2f31cb6463
1 changed files with 7 additions and 0 deletions
|
@ -426,6 +426,13 @@ def service_log(name, number=50):
|
|||
result["journalctl"] = _get_journalctl_logs(name, number).splitlines()
|
||||
|
||||
for log_path in log_list:
|
||||
|
||||
if not os.path.exists(log_path):
|
||||
continue
|
||||
|
||||
# Make sure to resolve symlinks
|
||||
log_path = os.path.realpath(log_path)
|
||||
|
||||
# log is a file, read it
|
||||
if os.path.isfile(log_path):
|
||||
result[log_path] = _tail(log_path, number)
|
||||
|
|
Loading…
Add table
Reference in a new issue