summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-09-06 14:05:43 -0700
committerRalph Boehme <slow@samba.org>2019-09-11 18:24:28 +0000
commitd9d704b01e21fbc6b05164a5d1fee772f1836fa9 (patch)
tree3407c404f255a8e0c66259ac5be1e2b58a3f6655
parent0c0ca0dbd7a7a6512b37ca8a186d814eed47b373 (diff)
downloadsamba-d9d704b01e21fbc6b05164a5d1fee772f1836fa9.tar.gz
s3: torture: vfstest: Change from create_conn_struct_tos() -> create_conn_struct_tos_cwd().
This does a vfs_ChDir() to the share root (not changing the directory) which correctly sets up the conn->cwd_fsp member so any XXXAT() calls correctly work inside vfstest. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--source3/torture/vfstest.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c
index 07079439135..6a2fe59a2d8 100644
--- a/source3/torture/vfstest.c
+++ b/source3/torture/vfstest.c
@@ -469,7 +469,7 @@ int main(int argc, const char *argv[])
struct vfs_state *vfs;
int i;
char *filename = NULL;
- char cwd[MAXPATHLEN];
+ char *cwd = NULL;
TALLOC_CTX *frame = talloc_stackframe();
struct auth_session_info *session_info = NULL;
NTSTATUS status = NT_STATUS_OK;
@@ -560,11 +560,18 @@ int main(int argc, const char *argv[])
return 1;
}
- status = create_conn_struct_tos(global_messaging_context(),
+ /* Provided by libreplace if not present. Always mallocs. */
+ cwd = get_current_dir_name();
+ if (cwd == NULL) {
+ return -1;
+ }
+
+ status = create_conn_struct_tos_cwd(global_messaging_context(),
-1,
- getcwd(cwd, sizeof(cwd)),
+ cwd,
session_info,
&c);
+ SAFE_FREE(cwd);
if (!NT_STATUS_IS_OK(status)) {
return 1;
}