I have replaced the file ownership check via the USER env variable (which is not guaranteed to be set, e.g. when running as root in docker) with a call to os.geteuid() to check against effective uid of the process.
euid vs. uid: I am not an os expert, but I am quite confident that checking against euid (instead of uid) is also the correct thing to do here, since I believe the file read/write system calls also operate with euid of the current process. But that is just an edge case, usually uid==euid.
Closes #240
I have replaced the file ownership check via the
USER
env variable (which is not guaranteed to be set, e.g. when running as root in docker) with a call toos.geteuid()
to check against effective uid of the process.euid vs. uid: I am not an os expert, but I am quite confident that checking against euid (instead of uid) is also the correct thing to do here, since I believe the file read/write system calls also operate with euid of the current process. But that is just an edge case, usually uid==euid.