2008-03-04 22:04:55

by bc Wong

[permalink] [raw]
Subject: [NFS] Choosing auth flavour in nfsmount.c

I think nfsmount.c violates rfc2623 section 2.7:

a NFS client SHOULD use the first flavor in the list that it
supports, on the assumption that the best access is
provided by the first flavor.

The code is on line 746:
i = mountres->auth_flavors.auth_flavors_len;
if (i <= 0)
goto noauth_flavors;

flavor = mountres->auth_flavors.auth_flavors_val;
while (--i >= 0) {
/* If no flavour requested, use first simple
* flavour that is offered.
*/
if (! (data.flags & NFS_MOUNT_SECFLAVOUR) &&
(flavor[i] == AUTH_SYS ||
flavor[i] == AUTH_NONE)) {
data.pseudoflavor = flavor[i];
data.flags |= NFS_MOUNT_SECFLAVOUR;
}
if (flavor[i] == data.pseudoflavor)
yum = 1;
#ifdef NFS_MOUNT_DEBUG
printf(_("auth flavor %d: %d\n"), i, flavor[i]);
#endif
}

If the server advertises AUTH_SYS and then AUTH_NONE,
the client will pick AUTH_NONE instead of AUTH_SYS.

I have a fix. What's the process of filing a bug? submitting
a patch? or getting involved with development?

Thanks,
bc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued.
Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs



2008-03-05 16:59:35

by Trond Myklebust

[permalink] [raw]
Subject: Re: [NFS] Choosing auth flavour in nfsmount.c


On Tue, 2008-03-04 at 14:04 -0800, bc Wong wrote:
> I think nfsmount.c violates rfc2623 section 2.7:
>
> a NFS client SHOULD use the first flavor in the list that it
> supports, on the assumption that the best access is
> provided by the first flavor.
>
> The code is on line 746:
> i = mountres->auth_flavors.auth_flavors_len;
> if (i <= 0)
> goto noauth_flavors;
>
> flavor = mountres->auth_flavors.auth_flavors_val;
> while (--i >= 0) {
> /* If no flavour requested, use first simple
> * flavour that is offered.
> */
> if (! (data.flags & NFS_MOUNT_SECFLAVOUR) &&
> (flavor[i] == AUTH_SYS ||
> flavor[i] == AUTH_NONE)) {
> data.pseudoflavor = flavor[i];
> data.flags |= NFS_MOUNT_SECFLAVOUR;
> }
> if (flavor[i] == data.pseudoflavor)
> yum = 1;
> #ifdef NFS_MOUNT_DEBUG
> printf(_("auth flavor %d: %d\n"), i, flavor[i]);
> #endif
> }
>
> If the server advertises AUTH_SYS and then AUTH_NONE,
> the client will pick AUTH_NONE instead of AUTH_SYS.
>
> I have a fix. What's the process of filing a bug? submitting
> a patch? or getting involved with development?

A patch should normally be sufficient, but please make sure that it
follows the guidelines in Documentation/SubmittingPatches (i.e. no major
style violations, a changelog entry at the top of the patch, and a
signed-off-by line).

Send all NFS client patches to me with a Cc to
linux-nfs-u79uwXL29TaiAVqoAR/[email protected]

Thanks,
Trond


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued.
Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs