Second part of fix for bug #8663 - deleting a symlink fails if the symlink target...
authorJeremy Allison <jra@samba.org>
Fri, 16 Dec 2011 23:37:07 +0000 (15:37 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 23 Jan 2012 20:30:23 +0000 (21:30 +0100)
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)

source3/smbd/trans2.c

index 129ab013e087f5150bda5f3dfdc0a58c404cc892..6f933dda5e0012477ded5f2069ee3b06f777d574 100644 (file)
@@ -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)) {