Fix bug #6939 - mangling method = hash breaks long filenames.
authorJeremy Allison <jra@samba.org>
Fri, 18 Dec 2009 00:14:30 +0000 (16:14 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 18 Dec 2009 00:14:30 +0000 (16:14 -0800)
We were returning the wrong sense of the bool. must_mangle()
has to return !NT_STATUS_IS_OK, not NT_STATUS_IS_OK.

Jeremy.

source3/smbd/mangle_hash.c

index 94bb184b0fda949814755febcb7c3d1244e90b0b..c08bc4019a3ad9b88e00fe69a8960167a4aa7461 100644 (file)
@@ -612,7 +612,10 @@ static bool must_mangle(const char *name,
        }
        status = is_valid_name(name_ucs2, False, False);
        TALLOC_FREE(name_ucs2);
-       return NT_STATUS_IS_OK(status);
+       /* We return true if we *must* mangle, so if it's
+        * a valid name (status == OK) then we must return
+        * false. Bug #6939. */
+       return !NT_STATUS_IS_OK(status);
 }
 
 /*****************************************************************************