diff options
author | Ken Raeburn <raeburn@mit.edu> | 2009-11-06 20:16:57 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2009-11-06 20:16:57 +0000 |
commit | f5660f6db098921809e70a0fe1adc3d568bb195f (patch) | |
tree | a89206cc7c463aad74ba5526c34165197ea80204 /src/tests | |
parent | 965c41375099ee25440ee09e9b4a2db56ca7d7e0 (diff) | |
download | krb5-f5660f6db098921809e70a0fe1adc3d568bb195f.tar.gz krb5-f5660f6db098921809e70a0fe1adc3d568bb195f.tar.xz krb5-f5660f6db098921809e70a0fe1adc3d568bb195f.zip |
Don't start by attempting to unlink replay caches by guessing
pathnames specific to my uid on MIT Athena systems. Instead, create a
replay cache object and then destroy it through the library. Tweak
the rcache-init-error messages to be specific to the instance that
failed.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23138 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/threads/t_rcache.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/tests/threads/t_rcache.c b/src/tests/threads/t_rcache.c index e3416f23c..f98e43001 100644 --- a/src/tests/threads/t_rcache.c +++ b/src/tests/threads/t_rcache.c @@ -79,7 +79,7 @@ static void try_one (struct tinfo *t) err = krb5_get_server_rcache(ctx, &piece, &my_rcache); if (err) { const char *msg = krb5_get_error_message(ctx, err); - fprintf(stderr, "%s while initializing replay cache\n", msg); + fprintf(stderr, "%s: %s while initializing replay cache\n", prog, msg); krb5_free_error_message(ctx, msg); exit(1); } @@ -125,15 +125,19 @@ int main (int argc, char *argv[]) int interval = 20 /* 5 * 60 */; prog = argv[0]; - unlink("/var/tmp/rc_hello_7882"); - unlink("/var/tmp/hello_7882"); n = 2; err = krb5_init_context(&ctx); if (err) { com_err(prog, err, "initializing context"); return 1; } -#ifdef INIT_ONCE + + /* + * For consistency, run the tests without an existing replay + * cache. Since there isn't a way to ask the library for the + * pathname that would be used for the rcache, we create an rcache + * object and then destroy it. + */ err = krb5_get_server_rcache(ctx, &piece, &rcache); if (err) { const char *msg = krb5_get_error_message(ctx, err); @@ -141,6 +145,25 @@ int main (int argc, char *argv[]) krb5_free_error_message(ctx, msg); return 1; } + err = krb5_rc_destroy(ctx, rcache); + if (err) { + const char *msg = krb5_get_error_message(ctx, err); + fprintf(stderr, "%s: %s while destroying old replay cache\n", + prog, msg); + krb5_free_error_message(ctx, msg); + return 1; + } + rcache = NULL; + +#ifdef INIT_ONCE + err = krb5_get_server_rcache(ctx, &piece, &rcache); + if (err) { + const char *msg = krb5_get_error_message(ctx, err); + fprintf(stderr, "%s: %s while initializing new replay cache\n", + prog, msg); + krb5_free_error_message(ctx, msg); + return 1; + } #endif end_time = time(0) + interval; #undef DIRECT |