Fix bug #8972 - Directory group write permission bit is set if unix extensions are...
authorJeremy Allison <jra@samba.org>
Wed, 13 Jun 2012 17:48:32 +0000 (10:48 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Jun 2012 17:53:45 +0000 (19:53 +0200)
We can't manipulate file_attributes if it's a posix call.
(cherry picked from commit bb750d7232bd266c06a14ac3ea577aeecfb81b14)

source3/smbd/open.c

index ded07a13761928aba862057b72e9a986563b181b..dfa45ef739a868b201eff51b14de8c035d5d5810 100644 (file)
@@ -2296,8 +2296,10 @@ static NTSTATUS open_directory(connection_struct *conn,
 
        SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
 
-       /* Ensure we have a directory attribute. */
-       file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
+       if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS)) {
+               /* Ensure we have a directory attribute. */
+               file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
+       }
 
        DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, "
                 "share_access = 0x%x create_options = 0x%x, "