The branch, v4-5-test has been updated
       via  8377d8a s3/smbd: fix the last resort check that sets the file type 
attribute
      from  cbf54e0 nss_wins: Fix errno values for HOST_NOT_FOUND

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test


- Log -----------------------------------------------------------------
commit 8377d8afbc072a4edbbc97263c94effb05b69137
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Nov 18 10:20:41 2016 -0800

    s3/smbd: fix the last resort check that sets the file type attribute
    
    The rule is, a directory (with any other attributes) should always also
    set FILE_ATTRIBUTE_DIRECTORY, a file should only set
    FILE_ATTRIBUTE_NORMAL if no other attributes is set.
    
    Iow, if a file contains any existing attributes (e.g. 
FILE_ATTRIBUTE_HIDDEN),
    don't add in the FILE_ATTRIBUTE_NORMAL attribute.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12436
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Ralph Boehme <s...@samba.org>
    
    Autobuild-User(master): Ralph Böhme <s...@samba.org>
    Autobuild-Date(master): Sat Nov 19 11:55:35 CET 2016 on sn-devel-144
    
    (cherry picked from commit a0783e8dd966a0b2d24d2ca5baa6bed3fe5a7d5a)
    
    Autobuild-User(v4-5-test): Karolin Seeger <ksee...@samba.org>
    Autobuild-Date(v4-5-test): Thu Dec  1 15:16:56 CET 2016 on sn-devel-144

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

Summary of changes:
 source3/smbd/dosmode.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index a376cbc..c80d240 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -636,12 +636,10 @@ uint32_t dos_mode(connection_struct *conn, struct 
smb_filename *smb_fname)
 
        result |= dos_mode_from_name(conn, smb_fname, result);
 
-       if (result == 0) {
-               if (S_ISDIR(smb_fname->st.st_ex_mode)) {
-                       result = FILE_ATTRIBUTE_DIRECTORY;
-               } else {
-                       result = FILE_ATTRIBUTE_NORMAL;
-               }
+       if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+               result |= FILE_ATTRIBUTE_DIRECTORY;
+       } else if (result == 0) {
+               result = FILE_ATTRIBUTE_NORMAL;
        }
 
        result = filter_mode_by_protocol(result);


-- 
Samba Shared Repository

Reply via email to