Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Feb 2021 11:04:52 +1100
From:      Chris Johns <chrisj@rtems.org>
To:        Rick Macklem <rmacklem@uoguelph.ca>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: sys/fs/nfsclient ACCESS attributes with RTEMS
Message-ID:  <5140b8d9-7f98-cd7d-eac0-9f938d73d320@rtems.org>
In-Reply-To: <5f66e68f-2979-dd14-f8f4-ee2bed0a5f43@rtems.org>
References:  <0e14503a-ca7b-cd0f-6472-289fc9ac301b@rtems.org> <YQXPR0101MB09680A67466B2FE37726CFA3DD839@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM> <5f66e68f-2979-dd14-f8f4-ee2bed0a5f43@rtems.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5140b8d9-7f98-cd7d-eac0-9f938d73d320>