summaryrefslogtreecommitdiff
path: root/common/test.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-06-01 09:17:00 +0200
committerDaiki Ueno <ueno@gnu.org>2019-06-18 14:17:28 +0200
commit6bebd5747aa49d4a124d23d4967f65a771799fe5 (patch)
treeecaf0c0a800f34e262d16dbaa4b3e6deeef4a5f4 /common/test.c
parent51382cd59c89e862443421a9d697a709f2244f36 (diff)
tests: Add tmpdir argument to p11_test_copy_setgid
To prevent BUILDDIR being embedded in the library.
Diffstat (limited to 'common/test.c')
-rw-r--r--common/test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/test.c b/common/test.c
index 3827ab0..9749a91 100644
--- a/common/test.c
+++ b/common/test.c
@@ -579,7 +579,8 @@ copy_file (const char *input,
}
char *
-p11_test_copy_setgid (const char *input)
+p11_test_copy_setgid (const char *input,
+ const char *tmpdir)
{
gid_t groups[128];
char *path;
@@ -600,7 +601,9 @@ p11_test_copy_setgid (const char *input)
return NULL;
}
- path = strdup (BUILDDIR "/test-setgid.XXXXXX");
+ if (asprintf(&path, "%s/test-setgid.XXXXXX", tmpdir) < 0)
+ assert_not_reached();
+
assert (path != NULL);
fd = mkstemp (path);