summaryrefslogtreecommitdiff
path: root/tests/tap/kerberos.c
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-08-25 15:08:05 -0700
committerRuss Allbery <rra@stanford.edu>2010-08-25 15:08:05 -0700
commit468ded4c2fae05a815bef91bdcb17d52f9cdcb2b (patch)
treeb2b836734664367c03691a8594684187a1be4054 /tests/tap/kerberos.c
parent32dc393016f0b6241dbf8d405638e18a33bb9b62 (diff)
Update to rra-c-util 2.6 and C TAP Harness 1.5
Update to C TAP Harness 1.5: * Better reporting of fatal errors in the test suite. * Summarize results at the end of test execution. * Add tests/HOWTO from docs/writing-tests in C TAP Harness. Update to rra-c-util 2.6: * Fix portability to bundled Heimdal on OpenBSD. * Improve checking for krb5_kt_free_entry with older MIT Kerberos. * Fix portability for missing krb5_get_init_creds_opt_free. * Fix header guard for util/xwrite.h. * Restore default compiler configuration after GSS-API library probe.
Diffstat (limited to 'tests/tap/kerberos.c')
-rw-r--r--tests/tap/kerberos.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/tests/tap/kerberos.c b/tests/tap/kerberos.c
index 700212e..a17d980 100644
--- a/tests/tap/kerberos.c
+++ b/tests/tap/kerberos.c
@@ -23,33 +23,6 @@
/*
- * Given the partial path to a file, look under BUILD and then SOURCE for the
- * file and return the full path to the file in newly-allocated memory.
- * Returns NULL if the file doesn't exist.
- */
-static char *
-find_file(const char *file)
-{
- char *base;
- char *path = NULL;
- const char *envs[] = { "BUILD", "SOURCE", NULL };
- int i;
-
- for (i = 0; envs[i] != NULL; i++) {
- base = getenv(envs[i]);
- if (base == NULL)
- continue;
- path = concatpath(base, file);
- if (access(path, R_OK) == 0)
- break;
- free(path);
- path = NULL;
- }
- return path;
-}
-
-
-/*
* Obtain Kerberos tickets for the principal specified in test.principal using
* the keytab specified in test.keytab, both of which are presumed to be in
* tests/data in either the build or the source tree.
@@ -78,7 +51,7 @@ kerberos_setup(void)
krb5_creds creds;
/* Read the principal name and find the keytab file. */
- path = find_file("data/test.principal");
+ path = test_file_path("data/test.principal");
if (path == NULL)
return NULL;
file = fopen(path, "r");
@@ -95,7 +68,7 @@ kerberos_setup(void)
bail("no newline in %s", path);
free(path);
principal[strlen(principal) - 1] = '\0';
- path = find_file("data/test.keytab");
+ path = test_file_path("data/test.keytab");
if (path == NULL)
return NULL;