You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mkleine@iobroker:~$ iobroker file read 0_userdata.0/test.txt
Error: EACCES: permission denied, open '/home/mkleine/test.txt'
at Object.openSync (node:fs:581:18)
at Object.writeFileSync (node:fs:2342:35)
at Immediate.<anonymous> (/opt/iobroker/node_modules/@iobroker/js-controller-cli/src/lib/setup.ts:2289:32)
at processImmediate (node:internal/timers:480:21) {
errno: -13,
code: 'EACCES',
syscall: 'open',
path: '/home/mkleine/test.txt'
}
The problem is, that /opt/iobroker/iobroker runs the command with sudo -H -u iobroker and the user iobroker has no permissions to write in my home dir.
else
sudo -H -u iobroker node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js "$@"
fi
Reproduction instruction
No response
The text was updated successfully, but these errors were encountered:
Short recap if coming back later: The behavior of read file is, read file from the database and write it to the current working directory if not specified other.
An alternative would be to let the read file command just write to stdout, then users could pipe stdout to file if needed, but would probably bring up other ugly cases and would also not fix other situations where this might occur.
All in all, this might be really tricky to get a nice behavior here, whole setup is (as desired normally) that everything runs as iobroker but of course has no permissions to user dirs where user might operate. For most scenarios the user will use admin files tab anyway, where files can be downloaded flawlessly.
No idea how to solve besides adding more command exceptions which are not executed by user iobroker or only displaying the file for this specific scenario. Any ideas @Apollon77?
No existing issues.
Description
Unable to read file:
The problem is, that
/opt/iobroker/iobroker
runs the command withsudo -H -u iobroker
and the useriobroker
has no permissions to write in my home dir.Reproduction instruction
No response
The text was updated successfully, but these errors were encountered: