Title
Editor fails to open root-only files: sudo fallback missing on file size check
Platform
Website - Chrome
Server Installation Method
Docker
Version
2.7.1
CLI Installation Method
None
CLI Version
No response
Troubleshooting
The Problem
Opening a root-only file in the file manager editor fails on 2.7.1. The editor
shows the correct metadata (size, modified date) but then displays "file is
empty", and a "Server error occurred" toast appears.
Browsing the same directory works fine, because listFiles retries with sudo
after a permission error. The editor's read path does not get that far: the
backend log shows the failure happens in the file size check, before the read
itself.
[INFO] [FILE] Permission denied for listFiles, retrying with sudo: /var/lib/docker/volumes/caddy_file/_data
[INFO] [FILE] Reading file [op:file_read,user:<redacted>,session:1]
[ERROR] [FILE] File size check failed: bash: line 1: /var/lib/docker/volumes/caddy_file/_data/Caddyfile: Permission denied
The error text "bash: line 1: : Permission denied" is a shell redirect
failing (e.g. wc -c < file), not a command like cat. So the size check runs
unelevated and aborts before the sudo fallback added in Termix#787 can take
effect.
How to Reproduce
- Log in as a non-root user with sudo rights (SSH key auth, sudo password
stored in Termix, sudo itself is NOT NOPASSWD).
- In the file manager, open /var/lib/docker/volumes//_data
(/var/lib/docker is 0710 root:root, so the user cannot traverse it).
- The listing appears - the sudo retry works here.
- Click any file to open it in the editor.
Additional Context
Expected: the file opens, using the same sudo escalation as listFiles.
Actual: empty editor, server error.
Verified on the host that sudo ls -l <dir> and sudo cat <file> both succeed,
so sudo is configured correctly.
This looks like an incomplete fix or a regression of #526 / Termix#787. Given
the file manager rework in 2.7.0, that release seems the likely point of
breakage, though I have not tested older versions.
Title
Editor fails to open root-only files: sudo fallback missing on file size check
Platform
Website - Chrome
Server Installation Method
Docker
Version
2.7.1
CLI Installation Method
None
CLI Version
No response
Troubleshooting
The Problem
Opening a root-only file in the file manager editor fails on 2.7.1. The editor
shows the correct metadata (size, modified date) but then displays "file is
empty", and a "Server error occurred" toast appears.
Browsing the same directory works fine, because listFiles retries with sudo
after a permission error. The editor's read path does not get that far: the
backend log shows the failure happens in the file size check, before the read
itself.
The error text "bash: line 1: : Permission denied" is a shell redirect
failing (e.g.
wc -c < file), not a command like cat. So the size check runsunelevated and aborts before the sudo fallback added in Termix#787 can take
effect.
How to Reproduce
stored in Termix, sudo itself is NOT NOPASSWD).
(/var/lib/docker is 0710 root:root, so the user cannot traverse it).
Additional Context
Expected: the file opens, using the same sudo escalation as listFiles.
Actual: empty editor, server error.
Verified on the host that
sudo ls -l <dir>andsudo cat <file>both succeed,so sudo is configured correctly.
This looks like an incomplete fix or a regression of #526 / Termix#787. Given
the file manager rework in 2.7.0, that release seems the likely point of
breakage, though I have not tested older versions.