From: Jeremy Allison Date: Fri, 18 Dec 2009 00:36:53 +0000 (-0800) Subject: Fix bug #6939 - mangling method = hash breaks long filenames. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f249d2d5893a3f8494e43fd1a805c78cee8eeec5;p=thirdparty%2Fsamba.git Fix bug #6939 - mangling method = hash breaks long filenames. We were returning the wrong sense of the bool. must_mangle() has to return !NT_STATUS_IS_OK, not NT_STATUS_IS_OK. Jeremy. --- diff --git a/source/smbd/mangle_hash.c b/source/smbd/mangle_hash.c index 69ecf77834b..5de69e21ab4 100644 --- a/source/smbd/mangle_hash.c +++ b/source/smbd/mangle_hash.c @@ -613,7 +613,10 @@ static bool must_mangle(const char *name, } status = is_valid_name(name_ucs2, False, False); SAFE_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); } /*****************************************************************************