summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-12-16 15:37:07 -0800
committerKarolin Seeger <kseeger@samba.org>2012-01-23 21:30:23 +0100
commitb0099de477a8f507e17e6221db8da4ca44a37294 (patch)
tree61e8d7081bd94c44b7bf0c901f5f0528b6aebcb1
parent92b8b043f1491541dfad06cc9e00a66dcaf4683a (diff)
downloadsamba-b0099de477a8f507e17e6221db8da4ca44a37294.tar.gz
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(). (cherry picked from commit cb5f2b3f9d5710ba66182e45bf8380c2f37b4190)
-rw-r--r--source3/smbd/trans2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 129ab013e08..6f933dda5e0 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7984,6 +7984,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
}
} else {
char *fname = NULL;
+ uint32_t ucf_flags = 0;
/* set path info */
if (total_params < 7) {
@@ -8000,10 +8001,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)) {