From: Jeremy Allison Date: Wed, 20 Jan 2021 20:27:16 +0000 (-0800) Subject: VFS: unityed_media: Fix um_mkdirat() to correctly look at the full pathname. X-Git-Tag: tevent-0.11.0~2030 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83686ff1e17273cf02b5ded418cd0b11e98548d8;p=thirdparty%2Fsamba.git VFS: unityed_media: Fix um_mkdirat() to correctly look at the full pathname. Missed in the original mkdirat fixes. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c index ac7ea4b404d..9337e88b7f1 100644 --- a/source3/modules/vfs_unityed_media.c +++ b/source3/modules/vfs_unityed_media.c @@ -742,26 +742,28 @@ static int um_mkdirat(vfs_handle_struct *handle, mode_t mode) { int status; - const char *path = smb_fname->base_name; + const char *path = NULL; struct smb_filename *client_fname = NULL; struct smb_filename *full_fname = NULL; + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + return -1; + } + + path = full_fname->base_name; DEBUG(10, ("Entering with path '%s'\n", path)); if (!is_in_media_files(path) || !is_in_media_dir(path)) { + TALLOC_FREE(full_fname); return SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode); } - full_fname = full_path_from_dirfsp_atname(talloc_tos(), - dirfsp, - smb_fname); - if (full_fname == NULL) { - return -1; - } - status = alloc_get_client_smb_fname(handle, talloc_tos(), full_fname, @@ -775,9 +777,9 @@ static int um_mkdirat(vfs_handle_struct *handle, client_fname, mode); err: + DEBUG(10, ("Leaving with path '%s'\n", path)); TALLOC_FREE(client_fname); TALLOC_FREE(full_fname); - DEBUG(10, ("Leaving with path '%s'\n", path)); return status; }