(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
This commit is contained in:
Johan Danielsson
2002-06-28 17:42:24 +00:00
parent 0ca28ed8e8
commit 6d6c02d255

View File

@@ -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);