gafusion / omas

Ordered Multidimensional Array Structure
http://gafusion.github.io/omas
MIT License
32 stars 15 forks source link

Fix owner check in omas_utils.py #245

Closed hetsko closed 1 year ago

hetsko commented 1 year ago

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 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.

orso82 commented 1 year ago

Thank you for your contribution @hetsko and sorry for getting only now on this!