sys/fs/nfsclient ACCESS attributes with RTEMS

Chris Johns chrisj at rtems.org
Sun Feb 21 00:05:07 UTC 2021


On 21/2/21 9:39 am, Chris Johns wrote:
> On 21/2/21 3:13 am, Rick Macklem wrote:
>> Chris Johns wrote:
>> 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.
> 
> Thanks, I will have a look. I have isolated a potential reason. The FreeBSD
> client has this in the RPC header:
> 
>     Credentials
>         Flavor: AUTH_UNIX (1)
>         Length: 32
>         Stamp: 0x5e72fba7
>         Machine Name: ruru
>             length: 4
>             contents: ruru
>         UID: 0
>         GID: 0
>         Auxiliary GIDs (2) [0, 5]
>             GID: 0
>             GID: 5
> 
> and my RTEMS client has:
> 
>     Credentials
>         Flavor: AUTH_UNIX (1)
>         Length: 20
>         Stamp: 0x21dae501
>         Machine Name: <EMPTY>
>             length: 0
>             contents: <EMPTY>
>         UID: 65536

I have traced the error down to this piece of code in rpc [1]:

	if (!xdr_uint32_t(xdrs, &cred->cr_uid))
		return (FALSE);
	if (!xdr_uint32_t(xdrs, &cred->cr_groups[0]))
		return (FALSE);

On RTEMS uid_t is int and this creates an incompatible pointer...

(gdb) p /x *(uint32_t*)&cred->cr_uid
$15 = 0x10000

Assigning the uid to the local junk variable and using that fixes my perms issue
and I can make a directory.

Chris

[1] https://cgit.freebsd.org/src/tree/sys/rpc/authunix_prot.c#n100


More information about the freebsd-hackers mailing list