[PATCH V2 7/7] ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be interpreted as hidden.

Vijay Kiran Kamuju infyquest at gmail.com
Sat Apr 27 21:20:04 CDT 2019


From: Sebastian Lackner <sebastian at fds-team.de>

From: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
---
 dlls/ntdll/file.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 3fefcf0981..f7b4bacd84 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -218,12 +218,15 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
         if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
     }
     *attr |= get_file_attributes( st );
-    /* convert Unix-style hidden files to a DOS hidden file attribute */
-    if (DIR_is_hidden_file( path ))
-        *attr |= FILE_ATTRIBUTE_HIDDEN;
     /* retrieve any stored DOS attributes */
     len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
-    if (len == -1) return ret;
+    if (len == -1)
+    {
+        /* convert Unix-style hidden files to a DOS hidden file attribute */
+        if (DIR_is_hidden_file( path ))
+            *attr |= FILE_ATTRIBUTE_HIDDEN;
+        return ret;
+    }
     *attr |= get_file_xattr( hexattr, len );
     return ret;
 }
@@ -236,7 +239,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr )
     /* Note: unix mode already set when called this way */
     attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
     len = sprintf( hexattr, "0x%x", attr );
-    if (attr != 0)
+    if (attr != 0 || DIR_is_hidden_file( path ))
         xattr_set( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, len );
     else
         xattr_remove( path, SAMBA_XATTR_DOS_ATTRIB );
-- 
2.21.0




More information about the wine-devel mailing list