Is there a way to change the UID / GID of only one thread in a multi-threaded process?
The reason for this is that the application for file submission is writing - ACLs and quotas are not applied, unless the caller’s uid / gid is set to the correct user, new files / directories are not created with the correct uid / gid, etc.
Network applications can usually use fork () at the beginning and process each user request in a separate process. If there is a need for shared data, it should go through some kind of shared memory. However, for example, FUSE (the linux user file system) uses multithreading by default and in combination with python bindings it would be impractical to try to use the forking model.
The "consistent" UID for the entire process appears to be POSIX compliant, however older Linux did not follow POSIX and allowed different uids for different threads. It seems that new kernels follow POSIX, is there a way to resolve the old "violation" of behavior?
source
share