I have a fairly simple fuse file system that logs requests, then forwards the request to an underlying ext4 file system.
When I copy files locally, in the kernel, the cred_t from the current thread shows the user making the request, which is what I want.
However when I NFS4 mount the fuse file systems, and copy a file over as user 217, the uid comes in as 0.
The strange thing is that when I NFS4 mount the underlying ext4 file system directly bypassing fuse), with identical mount options on the server and client then the uids come in correctly as 217..
I don't understand the difference, since the caller of fuse_open shouldn't know/care whether is is calling fuse_open vs ext4_file_open, so can anyone explain this difference, or even better tell me how I can get the requester uid and gid.
I have made kernel modifications to pass in the uid and gid from the kernel to the fuselib open calls.
$ uname -a
Linux bluefire.us.oracle.com 2.6.39-300.17.2.el5uek #1 SMP Wed Nov 7 17:34:26 PST 2012 x86_64 x86_64 x86_64 GNU/Linux
This is OEL5.8 (RHEL5u8)
I'm using FUSE 2.9.2
Server nfs4 options (/etc/exports):
Client options (etc/fstab):
bluefire:Container0 /mnt/nfs4/Container0 nfs4 rw,noatime,noauto,exec,suid,async 0 0
Debug code (in kernel):
In fuse_create_open() in dir.c and fuse_open in file.c:
const struct cred *c = __task_cred(current);
printk("process cred euid %u, suid %u, uid %u, egid %u, sgid %u, gid %u\n",
c->euid, c->suid, c->uid , c->egid, c->sgid, c->gid);
printk("fuse_create_open: inode i_uid %u, i_gid %u, i_mode %o i_ino %lu\n",
dir->i_uid, dir->i_gid, dir->i_mode, dir->i_ino);
Ceri Davies | Principal Software Engineer | Ceri.Davies@...
Work: +1 3032727810 x77810 | Home: +1 3035321116 | Cell: +1 3038706743
(Note: Home phone forwards to Cell, so try Home# first)
Oracle Storage | 500 Eldorado Blvd. | Broomfield, CO 80021
Oracle is committed to developing practices and products that help protect the environment