I have two chained FUSE filesystems that are intended to work together, both running as root: process P attempts to access file F first through FS1; FS1 looks to FS2. Now FS2 needs to obtain the context information (pid, user, and group) of P (rather than FS1) in order to verify that P has permission to access the files.
What is the recommended way to do this?