On Wed, Mar 25, 2009 at 01:45:44PM +0000, Barry Kelly wrote:
> I have "hide dot files" on, but I have noticed that while files with a
> single dot are hidden, files with multiple dots are not:
> 
> ".foo" - hidden
> "...foo" - not hidden
> 
> Is this by design? *nix certainly hide such files by default...
> 

Here's the fix ! Thanks,

Jeremy.
diff --git a/source/smbd/dosmode.c b/source/smbd/dosmode.c
index 69100bf..8a5a7b0 100644
--- a/source/smbd/dosmode.c
+++ b/source/smbd/dosmode.c
@@ -319,8 +319,10 @@ uint32 dos_mode_msdfs(connection_struct *conn, const char 
*path,SMB_STRUCT_STAT
                } else {
                        p = path;
                }
-               
-               if (p[0] == '.' && p[1] != '.' && p[1] != 0) {
+
+               /* Only . and .. are not hidden. */
+               if (p[0] == '.' && !((p[1] == '\0') ||
+                               (p[1] == '.' && p[2] == '\0'))) {
                        result |= aHIDDEN;
                }
        }
@@ -371,8 +373,10 @@ uint32 dos_mode(connection_struct *conn, const char 
*path,SMB_STRUCT_STAT *sbuf)
                } else {
                        p = path;
                }
-               
-               if (p[0] == '.' && p[1] != '.' && p[1] != 0) {
+
+               /* Only . and .. are not hidden. */
+               if (p[0] == '.' && !((p[1] == '\0') ||
+                               (p[1] == '.' && p[2] == '\0'))) {
                        result |= aHIDDEN;
                }
        }
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Reply via email to