From: Simon Wilkinson Date: Sat, 11 Sep 2010 11:53:07 +0000 (+0100) Subject: Unix CM: Don't blow up if we have non-rxkad tokens X-Git-Tag: upstream/1.8.0_pre1^2~4311 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=735f5b051521d047b18bef867042f59dc006098e;p=packages%2Fo%2Fopenafs.git 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 Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index f3f13fdbc..08d47f039 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -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)