diff options
author | Stef Walter <stef@thewalter.net> | 2013-07-17 09:51:32 +0200 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2013-07-18 08:13:20 +0200 |
commit | 81a6e16539e5e4a27c55194ae095cc4a75d08ade (patch) | |
tree | 70e409e938e60c326f95d85ac059efb58f48286a /trust/tests/test-token.c | |
parent | eb8f5859b1349f8147ba47a1da8032df192f2370 (diff) |
tools: Use $TMPDIR instead of $TEMP
TMPDIR is a more standard environment variable for locating the
temp directory on Unix. In addition since this is only used in
tests, remove the code from the generic p11_path_expand() func.
In general remove the possibility for forks to put $HOME or $TEMP
environment variables in configured paths. This was possible
due to code in p11_path_expand() but not something we supported.
https://bugzilla.redhat.com/show_bug.cgi?id=985017
Diffstat (limited to 'trust/tests/test-token.c')
-rw-r--r-- | trust/tests/test-token.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/trust/tests/test-token.c b/trust/tests/test-token.c index 6b998ca..3b7d701 100644 --- a/trust/tests/test-token.c +++ b/trust/tests/test-token.c @@ -76,10 +76,7 @@ setup (void *path) static void setup_temp (void *unused) { - test.directory = p11_path_expand ("$TEMP/test-module.XXXXXX"); - if (!mkdtemp (test.directory)) - assert_not_reached (); - + test.directory = p11_test_directory ("test-module"); setup (test.directory); } @@ -268,9 +265,7 @@ test_writable_no_exist (void) p11_token *token; char *path; - directory = p11_path_expand ("$TEMP/test-module.XXXXXX"); - if (!mkdtemp (directory)) - assert_not_reached (); + directory = p11_test_directory ("test-module"); path = p11_path_build (directory, "subdir", NULL); assert (path != NULL); |