The branch, v3-2-ctdb has been updated
       via  aae05b591ffcd4365a151ae9acee5f626b7cdf75 (commit)
       via  442a6a79dd249e202beba1ca4a1ea4b4f0e20564 (commit)
      from  f246f1e45374ef3a499f6322faee35c3e8489583 (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb


- Log -----------------------------------------------------------------
commit aae05b591ffcd4365a151ae9acee5f626b7cdf75
Author: Volker Lendecke <[email protected]>
Date:   Wed Apr 15 13:01:09 2009 +0200

    Do not use the file system GET_REAL_FILENAME for mangled names

commit 442a6a79dd249e202beba1ca4a1ea4b4f0e20564
Author: Volker Lendecke <[email protected]>
Date:   Mon Apr 27 16:59:01 2009 +0200

    Revert "Do not use the file system GET_REAL_FILENAME for mangled names"
    
    This reverts commit 5589d41d4ca1ad7db0227a1e7777e59c965b6c7c.

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

Summary of changes:
 source/smbd/filename.c |   42 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 36 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/filename.c b/source/smbd/filename.c
index c9d4963..697f7a8 100644
--- a/source/smbd/filename.c
+++ b/source/smbd/filename.c
@@ -36,6 +36,10 @@ static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx,
 static int get_real_filename_mangled(connection_struct *conn, const char *path,
                                     const char *name, TALLOC_CTX *mem_ctx,
                                     char **found_name);
+static int get_real_filename_internal(connection_struct *conn,
+                                     const char *path, const char *name,
+                                     bool mangled,
+                                     TALLOC_CTX *mem_ctx, char **found_name);
 
 /****************************************************************************
  Mangle the 2nd name and check if it is then equal to the first name.
@@ -815,22 +819,34 @@ static int get_real_filename_mangled(connection_struct 
*conn, const char *path,
                if (!mangled) {
                        /* Name is now unmangled. */
                        name = unmangled_name;
+               } else {
+                       /*
+                        * If we have mangled names, do not ask the VFS'es
+                        * GET_REAL_FILENAME. The Unix file system below does
+                        * not know about Samba's style of mangling.
+                        *
+                        * Boolean flags passed down are evil, the alternative
+                        * would be to pass a comparison function down into
+                        * the loop in get_real_filename_internal(). For now,
+                        * do the quick&dirty boolean flag approach.
+                        */
+                       return get_real_filename_internal(conn, path, name,
+                                                         true,
+                                                         mem_ctx, found_name);
                }
-               return get_real_filename(conn, path, name, mem_ctx,
-                                        found_name);
        }
 
        return SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx,
                                         found_name);
 }
 
-int get_real_filename(connection_struct *conn, const char *path,
-                     const char *name, TALLOC_CTX *mem_ctx,
-                     char **found_name)
+static int get_real_filename_internal(connection_struct *conn,
+                                     const char *path, const char *name,
+                                     bool mangled,
+                                     TALLOC_CTX *mem_ctx, char **found_name)
 {
        struct smb_Dir *cur_dir;
        const char *dname;
-       bool mangled;
        char *unmangled_name = NULL;
        long curpos;
 
@@ -881,6 +897,20 @@ int get_real_filename(connection_struct *conn, const char 
*path,
        return -1;
 }
 
+
+
+int get_real_filename(connection_struct *conn,
+                     const char *path, const char *name,
+                     TALLOC_CTX *mem_ctx, char **found_name)
+{
+       /*
+        * This is the default VFS function. If we end up here, we know we
+        * don't have mangled names around.
+        */
+       return get_real_filename_internal(conn, path, name, false,
+                                         mem_ctx, found_name);
+}
+
 static NTSTATUS build_stream_path(TALLOC_CTX *mem_ctx,
                                  connection_struct *conn,
                                  const char *orig_path,


-- 
SAMBA-CTDB repository

Reply via email to