From f352486f9649f5b2a24851d942a5f9c5f6b6e7cc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Dec 2011 11:56:01 -0800 Subject: [PATCH] Second part of fix for bug #8663 - deleting a symlink fails if the symlink target is outside of the share. Ensure we use UCF_UNIX_NAME_LOOKUP flags on filename_convert() when doing a restricted set of infolevels in trans2setfilepathinfo(). --- source3/smbd/trans2.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 93fa2911920..794c138638b 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7713,6 +7713,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn, } } else { char *fname = NULL; + uint32_t ucf_flags = 0; /* set path info */ if (total_params < 7) { @@ -7729,10 +7730,17 @@ static void call_trans2setfilepathinfo(connection_struct *conn, return; } + if (info_level == SMB_SET_FILE_UNIX_BASIC || + info_level == SMB_SET_FILE_UNIX_INFO2 || + info_level == SMB_FILE_RENAME_INFORMATION || + info_level == SMB_POSIX_PATH_UNLINK) { + ucf_flags |= UCF_UNIX_NAME_LOOKUP; + } + status = filename_convert(req, conn, req->flags2 & FLAGS2_DFS_PATHNAMES, fname, - 0, + ucf_flags, NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { -- 2.11.4.GIT