diff options
author | Jeremy Allison <jra@samba.org> | 2016-02-23 13:14:03 -0800 |
---|---|---|
committer | Uri Simchoni <uri@samba.org> | 2016-02-24 16:05:55 +0100 |
commit | 873df9a8a5508a3a4f51dfe447a5ffcdf18bab09 (patch) | |
tree | aa8516d7133a30fd2e353eaad9cefc0c695b2f83 /source3/torture | |
parent | d7f552cbbd173db941ef752fb70609eb1b0d0e70 (diff) | |
download | samba-873df9a8a5508a3a4f51dfe447a5ffcdf18bab09.tar.gz |
s3: VFS: Modify mkdir to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames().
Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8
(synthetic_smb_fname()) to cope with modules that
modify the incoming pathname.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Feb 24 16:05:55 CET 2016 on sn-devel-144
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/cmd_vfs.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 3a8b7f7136b..f9819da1c6b 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -200,12 +200,23 @@ static NTSTATUS cmd_readdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc static NTSTATUS cmd_mkdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { + struct smb_filename *smb_fname = NULL; + if (argc != 2) { printf("Usage: mkdir <path>\n"); return NT_STATUS_OK; } - if (SMB_VFS_MKDIR(vfs->conn, argv[1], 00755) == -1) { + smb_fname = synthetic_smb_fname(talloc_tos(), + argv[1], + NULL, + NULL); + + if (smb_fname == NULL) { + return NT_STATUS_NO_MEMORY; + } + + if (SMB_VFS_MKDIR(vfs->conn, smb_fname, 00755) == -1) { printf("mkdir error=%d (%s)\n", errno, strerror(errno)); return NT_STATUS_UNSUCCESSFUL; } |