]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r1866: Fix for bug #1602 reported by <m.proehl@science-computing.de>.
authorJeremy Allison <jra@samba.org>
Tue, 17 Aug 2004 18:59:13 +0000 (18:59 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:22 +0000 (10:52 -0500)
Access to a share with
wide links = No
follow symlinks = No
Was failing with access denied.
Jeremy.

source/smbd/vfs.c

index 13cfdac0f35de330ff651e7fe2aa99f34b5131c5..a47f040f6a87f41acf38b99071a72eaa407a2f69 100644 (file)
@@ -814,7 +814,7 @@ BOOL canonicalize_path(connection_struct *conn, pstring path)
  it is below dir in the heirachy. This uses realpath.
 ********************************************************************/
 
-BOOL reduce_name(connection_struct *conn, pstring fname)
+BOOL reduce_name(connection_struct *conn, const pstring fname)
 {
 #ifdef REALPATH_TAKES_NULL
        BOOL free_resolved_name = True;
@@ -924,7 +924,11 @@ BOOL reduce_name(connection_struct *conn, pstring fname)
        }
 
        if (!*p) {
-               pstrcpy(resolved_name, ".");
+               if (fname[0] == '.' && fname[1] == '/' && fname[2] == '\0') {
+                       pstrcpy(resolved_name, "./");
+               } else {
+                       pstrcpy(resolved_name, ".");
+               }
                p = resolved_name;
        }