From 735f5b051521d047b18bef867042f59dc006098e Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 11 Sep 2010 12:53:07 +0100 Subject: [PATCH] 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 --- src/afs/afs_pioctl.c | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.39.5