]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Don't give client an empty flavor list
authorJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 24 Aug 2009 12:20:10 +0000 (08:20 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 24 Aug 2009 12:20:10 +0000 (08:20 -0400)
In the absence of an explicit sec= option on an export, rpc.mountd
is returning a zero-length flavor list to clients in the MOUNT results.

The linux client doesn't seem to mind, but the Solaris client
(reasonably enough) is giving up; the symptom is a "security mode
does not match" error on mount.

We could modify the export-parsing code to ensure the secinfo array
is nonzero.  But I think it's slightly simpler to handle this default
case in the implementation of the MOUNT call.  This is more-or-less the
same thing the kernel does when mountd passes it an export without any
security flavors specified.

Thanks to Tom Haynes for bug report and diagnosis.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/mountd.c

index b59f939ee71154e2bd1ec3535c4d7987ea26e1db..888fd8c92b3da19a42e3964407c680415ccfbe89 100644 (file)
@@ -359,6 +359,11 @@ static void set_authflavors(struct mountres3_ok *ok, nfs_export *exp)
                flavors[i] = s->flav->fnum;
                i++;
        }
                flavors[i] = s->flav->fnum;
                i++;
        }
+       if (i == 0) {
+               /* default when there is no sec= option: */
+               i = 1;
+               flavors[0] = AUTH_UNIX;
+       }
        ok->auth_flavors.auth_flavors_val = flavors;
        ok->auth_flavors.auth_flavors_len = i;
 }
        ok->auth_flavors.auth_flavors_val = flavors;
        ok->auth_flavors.auth_flavors_len = i;
 }