The branch, master has been updated
       via  c5cbe48 Third part of fix for bug #8663 - deleting a symlink fails 
if the symlink target is outside of the share.
       via  f448c0e Second part of fix for bug #8663 - deleting a symlink fails 
if the symlink target is outside of the share.
       via  8eca223 First part of fix for bug #8663 - deleting a symlink fails 
if the symlink target is outside of the share.
      from  d62de8d lib/param: Set s4 "host msdfs = true" by default

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c5cbe481a759316be5d598123233cc859078d74a
Author: Jeremy Allison <[email protected]>
Date:   Thu Dec 15 16:55:32 2011 -0800

    Third part of fix for bug #8663 - deleting a symlink fails if the symlink 
target is outside of the share.
    
    smbd_check_access_rights() - we can always delete a symlink.
    
    Autobuild-User: Jeremy Allison <[email protected]>
    Autobuild-Date: Fri Dec 16 03:32:15 CET 2011 on sn-devel-104

commit f448c0e6db1384425e78531150aa1d3f6f8bd951
Author: Jeremy Allison <[email protected]>
Date:   Thu Dec 15 16:33:37 2011 -0800

    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 UNIX infolevel in trans2setfilepathinfo().

commit 8eca2231238d0088b8a25409fdaf5fb2e837b330
Author: Jeremy Allison <[email protected]>
Date:   Thu Dec 15 16:31:51 2011 -0800

    First part of fix for bug #8663 - deleting a symlink fails if the symlink 
target is outside of the share.
    
    Remove two unneeded check_name() calls. They have already been done
    in order to get here.

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/open.c   |   20 ++++++++------------
 source3/smbd/trans2.c |    7 ++++++-
 2 files changed, 14 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 433bc09..9174388 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -99,6 +99,14 @@ NTSTATUS smbd_check_access_rights(struct connection_struct 
*conn,
                return NT_STATUS_OK;
        }
 
+       if (access_mask == DELETE_ACCESS && S_ISLNK(smb_fname->st.st_ex_mode)) {
+               /* We can always delete a symlink. */
+               DEBUG(10,("smbd_check_access_rights: not checking ACL "
+                       "on DELETE_ACCESS on symlink %s.\n",
+                       smb_fname_str_dbg(smb_fname) ));
+               return NT_STATUS_OK;
+       }
+
        status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name,
                        (SECINFO_OWNER |
                        SECINFO_GROUP |
@@ -1723,11 +1731,6 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
                }
        }
 
-       status = check_name(conn, smb_fname->base_name);
-       if (!NT_STATUS_IS_OK(status)) {
-               return status;
-       }
-
        if (!posix_open) {
                new_dos_attributes &= SAMBA_ATTRIBUTES_MASK;
                if (file_existed) {
@@ -3846,13 +3849,6 @@ NTSTATUS create_file_default(connection_struct *conn,
                }
        }
 
-       /* All file access must go through check_name() */
-
-       status = check_name(conn, smb_fname->base_name);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto fail;
-       }
-
        if (stream_name && is_ntfs_default_stream_smb_fname(smb_fname)) {
                int ret;
                smb_fname->stream_name = NULL;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 0126419..4417cb2 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -8007,6 +8007,7 @@ static void call_trans2setfilepathinfo(connection_struct 
*conn,
                }
        } else {
                char *fname = NULL;
+               uint32_t ucf_flags = 0;
 
                /* set path info */
                if (total_params < 7) {
@@ -8023,10 +8024,14 @@ static void 
call_trans2setfilepathinfo(connection_struct *conn,
                        return;
                }
 
+               if (INFO_LEVEL_IS_UNIX(info_level)) {
+                       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)) {


-- 
Samba Shared Repository

Reply via email to