Unix CM: Don't blow up if we have non-rxkad tokens

The legacy GetToken compatibility code assumed that we would always
have at least one rxkad token for a cell, and segfaulted if we didn't.

Just return as if we have no tokens if a cell doesn't have an rxkad
token.

Change-Id: Ica64882c1a64cf140ad6c277c70fbfb747ea6235
Reviewed-on: http://gerrit.openafs.org/3614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2010-09-11 12:53:07 +01:00 committed by Derrick Brashear
parent c8fc94fb86
commit 735f5b0515

View 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)