auth_gss: the list of pseudoflavors not being parsed correctly
authorSteve Dickson <steved@redhat.com>
Thu, 3 May 2012 15:47:08 +0000 (11:47 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 3 May 2012 16:35:33 +0000 (12:35 -0400)
gss_mech_list_pseudoflavors() parses a list of registered mechanisms.
On that list contains a list of pseudo flavors which was not being
parsed correctly, causing only the first pseudo flavor to be found.

Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/auth_gss/gss_mech_switch.c

index ca8cad8251c7ff1c13c9bff6757e098c4f1cd9b2..782bfe1b64650d991489d25f94ca7debf05e8ecb 100644 (file)
@@ -242,12 +242,13 @@ EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor);
 int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr)
 {
        struct gss_api_mech *pos = NULL;
-       int i = 0;
+       int j, i = 0;
 
        spin_lock(&registered_mechs_lock);
        list_for_each_entry(pos, &registered_mechs, gm_list) {
-               array_ptr[i] = pos->gm_pfs->pseudoflavor;
-               i++;
+               for (j=0; j < pos->gm_pf_num; j++) {
+                       array_ptr[i++] = pos->gm_pfs[j].pseudoflavor;
+               }
        }
        spin_unlock(&registered_mechs_lock);
        return i;