The branch, master has been updated
       via  19213b8 Ensure when creating a directory, if we make any changes 
due to inheritance parameters, we update the stat returned.
       via  c6bc1ee Part 4 of bugfix for #8211 - "inherit owner = yes" doesn't 
interact correctly with "inherit permissions = yes" and POSIX ACLs
      from  0931147 s3:selftest: add a few more raw.* tests

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


- Log -----------------------------------------------------------------
commit 19213b83d6cd5a7deeb6fab8d9fde304290a447c
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Jun 8 14:36:12 2011 -0700

    Ensure when creating a directory, if we make any changes due to inheritance 
parameters, we update the stat returned.
    
    Autobuild-User: Jeremy Allison <j...@samba.org>
    Autobuild-Date: Thu Jun  9 00:46:39 CEST 2011 on sn-devel-104

commit c6bc1eeb7b93fde84dae5d81eedd0610aef1726e
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Jun 8 14:26:02 2011 -0700

    Part 4 of bugfix for #8211 - "inherit owner = yes" doesn't interact 
correctly with "inherit permissions = yes" and POSIX ACLs
    
    We don't need to check mode bits as well as dev/ino to
    ensure we're in the same place.

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

Summary of changes:
 source3/smbd/open.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 3603a81..06de8ab 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -318,10 +318,9 @@ NTSTATUS change_dir_owner_to_parent(connection_struct 
*conn,
 
        /* Ensure we're pointing at the same place. */
        if (smb_fname_cwd->st.st_ex_dev != psbuf->st_ex_dev ||
-           smb_fname_cwd->st.st_ex_ino != psbuf->st_ex_ino ||
-           smb_fname_cwd->st.st_ex_mode != psbuf->st_ex_mode ) {
+           smb_fname_cwd->st.st_ex_ino != psbuf->st_ex_ino) {
                DEBUG(0,("change_dir_owner_to_parent: "
-                        "device/inode/mode on directory %s changed. "
+                        "device/inode on directory %s changed. "
                         "Refusing to chown !\n", fname ));
                status = NT_STATUS_ACCESS_DENIED;
                goto chdir;
@@ -2569,6 +2568,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
        char *parent_dir;
        NTSTATUS status;
        bool posix_open = false;
+       bool need_re_stat = false;
 
        if(!CAN_WRITE(conn)) {
                DEBUG(5,("mkdir_internal: failing create on read-only share "
@@ -2623,6 +2623,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
        if (lp_inherit_perms(SNUM(conn))) {
                inherit_access_posix_acl(conn, parent_dir,
                                         smb_dname->base_name, mode);
+               need_re_stat = true;
        }
 
        if (!posix_open) {
@@ -2637,6 +2638,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
                        SMB_VFS_CHMOD(conn, smb_dname->base_name,
                                      (smb_dname->st.st_ex_mode |
                                          (mode & ~smb_dname->st.st_ex_mode)));
+                       need_re_stat = true;
                }
        }
 
@@ -2645,6 +2647,15 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
                change_dir_owner_to_parent(conn, parent_dir,
                                           smb_dname->base_name,
                                           &smb_dname->st);
+               need_re_stat = true;
+       }
+
+       if (need_re_stat) {
+               if (SMB_VFS_LSTAT(conn, smb_dname) == -1) {
+                       DEBUG(2, ("Could not stat directory '%s' just created: 
%s\n",
+                         smb_fname_str_dbg(smb_dname), strerror(errno)));
+                       return map_nt_error_from_unix(errno);
+               }
        }
 
        notify_fname(conn, NOTIFY_ACTION_ADDED, FILE_NOTIFY_CHANGE_DIR_NAME,


-- 
Samba Shared Repository

Reply via email to