Add support for mount export for fuse-nfs#140
Add support for mount export for fuse-nfs#140afbjorklund wants to merge 1 commit intowillscott:masterfrom
Conversation
willscott
left a comment
There was a problem hiding this comment.
I'm okay with the general structure of allowing a custom auth handler to implement Export. I think the degraded case for null auth probably should be closer to 'not supporting it'
|
I couldn't figure out if ex_groups was allowed to be empty or not, so added "anonymous" (a synonym for |
|
I used |
|
My reading is that groups can be nil, since it's defined as a pointer. |
|
Sure, it still works even without the groups. // List of all exported file systems.
func (h *NullAuthHandler) Export(context.Context) []nfs.Export {
- groups := []nfs.Group{{Name: []byte("anonymous")}}
- return []nfs.Export{{Dir: []byte("/mount"), Groups: groups}}
+ return []nfs.Export{{Dir: []byte("/mount")}}
}
|
It wants to list the exported file systems, for mount. But currently the nullauth ignores the dirpath anyway. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
| // Export contains an export node, with information about an exported filesystem. | ||
| type Export struct { | ||
| Dir []byte | ||
| Groups []Group |
There was a problem hiding this comment.
I believe this is *Group rather than []Group - in that it is either nil or the next group in a linked list, right?
There was a problem hiding this comment.
It is, but the Go wrapper "helpfully" dereferences all pointers - so we declare it as an array instead.
There was a problem hiding this comment.
They are documented as equivalent in XDR: https://datatracker.ietf.org/doc/html/rfc1014#section-3.18
There was a problem hiding this comment.
The pattern in the rest of this library has been to write the individual fields with the extra 0 to signify the end of the list
e.g. https://github.com/willscott/go-nfs/blob/master/nfs_onreaddir.go#L116
while this is more fiddly, it makes the type 'logically correct', so that the caller doesn't have to understand the nuance.
willscott
left a comment
There was a problem hiding this comment.
The main consideration I've been trying to think through is whether this is a good 'core type' for ACL groups - since the rest of auth is not implemented here, I worry that a partial type would be hard for a separate implementation of an auth handler / auth to be able to integrate.
That makes me wonder if there's either a way to more generally stub out this part of mounting for implementation in a custom authentication handler, or if there's a complete but still simple authentication example that can do both this and use of the opaque group object.
I'm not asking for that from you, but I'm going to take a couple more days to go back to the spec to make sure the interface for the library is decent.
| // Export contains an export node, with information about an exported filesystem. | ||
| type Export struct { | ||
| Dir []byte | ||
| Groups []Group |
There was a problem hiding this comment.
The pattern in the rest of this library has been to write the individual fields with the extra 0 to signify the end of the list
e.g. https://github.com/willscott/go-nfs/blob/master/nfs_onreaddir.go#L116
while this is more fiddly, it makes the type 'logically correct', so that the caller doesn't have to understand the nuance.
mount: only root can use "--options" optionLed me to: https://github.com/sahlberg/fuse-nfs
It wants to list the exported file systems, for mount.
But currently the nullauth ignores the dirpath anyway.