The branch, v3-5-test has been updated
       via  8702bdb... Fix bug 6891 - using windows explorer to change 
ownership on a folder fails with Bad File Descriptor. Jeremy. (cherry picked 
from commit 6747a91ca0c350374c54bac5892cf96e5aed029f)
      from  01cb74f... Ensure every return path initializes presult as NULL. 
Ensures no crashes in calling code that forgets to init return as null. Jeremy. 
(cherry picked from commit 83c2c177a5e86d04da37384f1f04230c8274e1e6)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 8702bdbeb552537d10b875b18ca814b9912058af
Author: Jeremy Allison <[email protected]>
Date:   Thu Nov 12 13:08:04 2009 -0800

    Fix bug 6891 - using windows explorer to change ownership on a folder fails 
with Bad File Descriptor.
    Jeremy.
    (cherry picked from commit 6747a91ca0c350374c54bac5892cf96e5aed029f)

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

Summary of changes:
 source3/smbd/posix_acls.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 26e609f..15ea4d5 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3594,7 +3594,17 @@ int try_chown(connection_struct *conn, struct 
smb_filename *smb_fname,
 
        become_root();
        /* Keep the current file gid the same. */
-       ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
+       if (fsp->fh->fd == -1) {
+               if (lp_posix_pathnames()) {
+                       ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name, uid,
+                                           (gid_t)-1);
+               } else {
+                       ret = SMB_VFS_CHOWN(conn, smb_fname->base_name, uid,
+                                           (gid_t)-1);
+               }
+       } else {
+               ret = SMB_VFS_FCHOWN(fsp, uid, (gid_t)-1);
+       }
        unbecome_root();
 
        close_file_fchmod(NULL, fsp);


-- 
Samba Shared Repository

Reply via email to