From 6d6c02d25554762fb2eff9ca471a714f9b5f5449 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Fri, 28 Jun 2002 17:42:24 +0000 Subject: [PATCH] (display_tokens): don't bail out before we get EDOM (signaling the end of the tokens), the kernel can also return ENOTCONN, meaning that the index does not exist anymore (for example if the token has expired) git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11042 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kuser/klist.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kuser/klist.c b/kuser/klist.c index 04aae6b7f..2ec7bbf40 100644 --- a/kuser/klist.c +++ b/kuser/klist.c @@ -483,7 +483,7 @@ display_tokens(int do_verbose) parms.out = (void *)t; parms.out_size = sizeof(t); - for (i = 0; k_pioctl(NULL, VIOCGETTOK, &parms, 0) == 0; i++) { + for (i = 0;; i++) { int32_t size_secret_tok, size_public_tok; unsigned char *cell; struct ClearToken ct; @@ -491,6 +491,11 @@ display_tokens(int do_verbose) struct timeval tv; char buf1[20], buf2[20]; + if(k_pioctl(NULL, VIOCGETTOK, &parms, 0) < 0) { + if(errno == EDOM) + break; + continue; + } memcpy(&size_secret_tok, r, sizeof(size_secret_tok)); /* dont bother about the secret token */ r += size_secret_tok + sizeof(size_secret_tok);