sys/fs/nfsclient ACCESS attributes with RTEMS
Rick Macklem
rmacklem at uoguelph.ca
Sat Feb 20 16:13:25 UTC 2021
Chris Johns wrote:
>I have made some progress in porting the FreeBSD kernel NFS client file system
>to RTEMS. The connection to an NVFv4 server is stable and I can change
>directories, list directories and read files. I however cannot make a directory.
>I get a permissions error. This is the fragment of traffic showing the error:
>
>10.10.5.45 -> 10.10.5.4 NFS 246 V4 Call Access ACCESS FH: 0xbb937afe, [Check: RD
>LU MD XT DL XE]
>10.10.5.4 -> 10.10.5.45 NFS 350 V4 Reply (Call In 72) Access ACCESS, [NOT
>Supported: XE], [Access Denied: MD XT DL], [Allowed: RD LU]
For whatever reason, the client only has read/lookup access to 0xbb937afe (presumably
a directory).
>10.10.5.45 -> 10.10.5.4 NFS 282 V4 Call Lookup LOOKUP DH: 0xbb937afe/read_write_test
>10.10.5.4 -> 10.10.5.45 NFS 342 V4 Reply (Call In 74) Lookup LOOKUP Status:
>NFS4ERR_NOENT
>10.10.5.45 -> 10.10.5.4 NFS 282 V4 Call Lookup LOOKUP DH: 0xbb937afe/read_write_test
>10.10.5.4 -> 10.10.5.45 NFS 342 V4 Reply (Call In 76) Lookup LOOKUP Status:
>NFS4ERR_NOENT
>10.10.5.45 -> 10.10.5.4 NFS 358 V4 Call Create CREATE
>10.10.5.4 -> 10.10.5.45 NFS 210 V4 Reply (Call In 78) Create CREATE Status:
>NFS4ERR_ACCESS
>
>The server is set up for an NFSv4 export and I have `no_squash_root` set for
>testing. There is no security enabled (nfs at ...). The RTEMS client mount options are:
Since "no_quash_root" doesn't exist on FreeBSD NFS servers (implemented with the
-maproot export option on FreeBSD), I'll assume a non-FreeBSD server.
--> As such, I have no idea why the access is limited. (mode bits, ACL,...?).
If you test against a FreeBSD server, you can "sysctl vfs.nfsd.debuglevel=4" and
make it pretty chatty to help figure out what is going on.
rick
ma = mount_arg(ma, "rw", NULL, 0);
ma = mount_arg(ma, "nfsv4", NULL, 0);
ma = mount_arg(ma, "minorversion", "1", -1);
ma = mount_arg(ma, "nolockd", NULL, 0);
error = kernel_mount(ma, MNT_VERIFIED);
The mount seems OK. The cred used in all the calls is the same and has uid=0, gid=0.
The fragment of code I am using to test with runs fine from a FreeBSD shell as
root. The ACCESS attributes for the FreeBSD test executable is:
10.10.5.2 -> 10.10.5.4 NFS 210 V4 Call Access ACCESS FH: 0x18096ab3, [Check: RD
LU MD XT DL XE]
10.10.5.4 -> 10.10.5.2 NFS 302 V4 Reply (Call In 67) Access ACCESS, [NOT
Supported: XE], [Allowed: RD LU MD XT DL]
The same ACCESS attributes for the RTEMS client is:
10.10.5.45 -> 10.10.5.4 NFS 246 V4 Call Access ACCESS FH: 0xbb937afe, [Check: RD
LU MD XT DL XE]
10.10.5.4 -> 10.10.5.45 NFS 350 V4 Reply (Call In 72) Access ACCESS, [NOT
Supported: XE], [Access Denied: MD XT DL], [Allowed: RD LU]
I do not know what or where in the connection or mount triggers this behaviour
in the server. What is the reason for this and where could I take a look to see
what I have not set up in my client?
Thanks
Chris
_______________________________________________
freebsd-hackers at freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list