To prevent BUILDDIR being embedded in the library.
ret = p11_test_run_child (args, true);
assert_num_eq (ret, 0);
- path = p11_test_copy_setgid (args[0]);
+ path = p11_test_copy_setgid (args[0], BUILDDIR);
if (path == NULL)
return;
ret = p11_test_run_child (args, true);
assert_num_eq (ret, 5);
- path = p11_test_copy_setgid (args[0]);
+ path = p11_test_copy_setgid (args[0], BUILDDIR);
if (path == NULL)
return;
}
char *
-p11_test_copy_setgid (const char *input)
+p11_test_copy_setgid (const char *input,
+ const char *tmpdir)
{
gid_t groups[128];
char *path;
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);
#ifdef OS_UNIX
-char * p11_test_copy_setgid (const char *path);
+char * p11_test_copy_setgid (const char *path,
+ const char *tmpdir);
int p11_test_run_child (const char **argv,
bool quiet_out);
ret = p11_test_run_child (args, true);
assert_num_eq (ret, 33);
- path = p11_test_copy_setgid (args[0]);
+ path = p11_test_copy_setgid (args[0], BUILDDIR);
if (path == NULL)
return;