From b1d8bb6a40222c19e496c1812a78e7796f82b4e3 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 19 May 2020 21:34:26 +0200 Subject: [PATCH] s3/torture: use SMB_VFS_OPENAT() in cmd_open() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/torture/cmd_vfs.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 3c16b73310a..3e237607410 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -294,6 +294,7 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c mode_t mode; const char *flagstr; files_struct *fsp; + struct files_struct *fspcwd = NULL; struct smb_filename *smb_fname = NULL; NTSTATUS status; int ret; @@ -393,7 +394,17 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c fsp->fsp_name = smb_fname; - fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, flags, mode); + status = vfs_at_fspcwd(fsp, vfs->conn, &fspcwd); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + fsp->fh->fd = SMB_VFS_OPENAT(vfs->conn, + fspcwd, + smb_fname, + fsp, + flags, + mode); if (fsp->fh->fd == -1) { printf("open: error=%d (%s)\n", errno, strerror(errno)); TALLOC_FREE(fsp);