Unix CM: Don't blow up if we have non-rxkad tokens
[openafs.git] / src / afs / afs_pioctl.c
index 5bd07d8..08d47f0 100644 (file)
@@ -2333,6 +2333,11 @@ DECL_PIOCTL(PGetTokens)
     }
     token = afs_FindToken(tu->tokens, RX_SECIDX_KAD);
 
+    /* If they don't have an RXKAD token, but do have other tokens,
+     * then sadly there's nothing this interface can do to help them. */
+    if (token == NULL)
+       return ENOTCONN;
+
     /* for compat, we try to return 56 byte tix if they fit */
     iterator = token->rxkad.ticketLen;
     if (iterator < 56)
@@ -4362,7 +4367,6 @@ DECL_PIOCTL(PGetInitParams)
 
     return afs_pd_putBytes(aout, &cm_initParams,
                           sizeof(struct cm_initparams));
-    return 0;
 }
 
 #ifdef AFS_SGI65_ENV