summaryrefslogtreecommitdiff
path: root/source4/torture/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/util.c')
-rw-r--r--source4/torture/util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/torture/util.c b/source4/torture/util.c
index 5df90163ad..d59de9459f 100644
--- a/source4/torture/util.c
+++ b/source4/torture/util.c
@@ -26,9 +26,10 @@
/**
create a temporary directory.
*/
-_PUBLIC_ NTSTATUS torture_temp_dir(TALLOC_CTX *mem_ctx, char **tempdir)
+_PUBLIC_ NTSTATUS torture_temp_dir(TALLOC_CTX *mem_ctx, const char *prefix,
+ char **tempdir)
{
- *tempdir = talloc_strdup(mem_ctx, "torture-tmp.XXXXXX");
+ *tempdir = talloc_asprintf(mem_ctx, "torture.tmp-%s.XXXXXX", prefix);
if (mkdtemp(*tempdir) == NULL)
return NT_STATUS_UNSUCCESSFUL;
@@ -48,6 +49,7 @@ BOOL nt_time_equal(NTTIME *t1, NTTIME *t2)
* Provision a Samba installation using @param setupdir_script and start smbd.
*/
NTSTATUS torture_setup_server(TALLOC_CTX *mem_ctx,
+ const char *prefix,
const char *setupdir_script,
const char *smbd_path,
pid_t *smbd_pid)
@@ -61,7 +63,7 @@ NTSTATUS torture_setup_server(TALLOC_CTX *mem_ctx,
*smbd_pid = -1;
- status = torture_temp_dir(mem_ctx, &tempdir);
+ status = torture_temp_dir(mem_ctx, prefix, &tempdir);
if (NT_STATUS_IS_ERR(status)) {
return status;
}