sahlberg / fuse-nfs

A FUSE module for NFSv3/4
GNU General Public License v3.0
172 stars 41 forks source link

Map uid and gid back to the current user… #7

Closed julian-hj closed 7 years ago

julian-hj commented 7 years ago

… on stat operations when they are specified on the mount URL.

Signed-off-by: Paul Warren paul.warren@emc.com

Note: After digging around in the code for a while, we are wondering if this change should be wired into libnfs instead of this library. We considered putting the pull request in against that repo instead, but eventually we decided that we are not qualified to make the change there, as it would require adding accessors to be able to find the UID and GID in the rpc context, and we weren't confident about the best way to go about that. The change in this pull request works nicely but is perhaps a little bit architecturally icky because the id mappings are implemented in different layers going in and out.

sahlberg commented 7 years ago

Merged. Thanks.

We probably should do this mapping also for chown/chgrp and add something in the README for these special semantics when using uid=/gid= in the URL.

I can add that unless you want to.

Orthogonal to your nice addition here, it does highlight another issue in fuse-nfs. I should start using fuse_context->{uid|gid} and use it to set the rpc credentials explicitly before any of the libnfs calls so that you get the right uid when multiple users are sharing the same fuse-nfs mount. I guess that no one has noticed just indicates how rare use of this module is :-( I will fix that, I am not asking you to fix that.

paulcwarren commented 7 years ago

Agreed on the chown/chgrp behavior. We think that it would make sense for these operations to exhibit the same semantics as read/write. We'll plan to add that behavior by adding a task to our backlog. Thanks for the merge :+1: