]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Unix CM: Don't blow up if we have non-rxkad tokens
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 11 Sep 2010 11:53:07 +0000 (12:53 +0100)
committerDerrick Brashear <shadow@dementia.org>
Mon, 3 Jan 2011 14:38:18 +0000 (06:38 -0800)
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>
src/afs/afs_pioctl.c

index f3f13fdbcde23986415eb5609cdcf2ad32976bcd..08d47f0395aba2ecff77ce1587c076a5cd7f1fa9 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)