Say I created a FUSE filesystem called foo and mounted it at /mnt/foo.

If I have a user called myuser that is running vi to open a file in /mnt/foo, what FUSE methods or data structure contains the info about the user and process? I'd want the actual name of the user/group and process, or the RUID and PID.

I've been staring at this but I can't find the information I mention from the doxygen documentation.

  • 4
    Programming questions are off-topic here, but can be asked on Stack Overflow. Due to an artificial system restriction, it is no longer possible to migrate this question. – Gilles 'SO- stop being evil' Dec 16 '17 at 18:48
  • 1
    This is not a programming question. It happens to have a programming answer, but I believe that that shouldn’t make the question off-topic. Just looking at the question, it could have had an answer involving /proc, /sys, or something similar. – G-Man Says 'Reinstate Monica' Dec 17 '17 at 1:12
  • This isn't a programming question. This is a question involving code. Are users not allowed to ask questions about Unix utilities now? – Faheem Mitha Dec 17 '17 at 23:13
  • The question explicitly asks about "FUSE methods or data structure[s]". Code, not utilities. – muru Dec 20 '17 at 12:42

During the call to a fuse operation you can call fuse_get_context() to get the current calling user id, group id, process id, and umask in a fuse_context Struct.

struct fuse_context {
        struct fuse *fuse;
        uid_t uid;
        gid_t gid;
        pid_t pid;
        void *private_data;
        mode_t umask;

Here's a doc and bsd man page mentioning this function.

Not the answer you're looking for? Browse other questions tagged or ask your own question.