summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-12-17 16:36:53 -0800
committerKarolin Seeger <kseeger@samba.org>2010-01-13 14:01:05 +0100
commit9aab74eaca37b49ad9453d64ede85651f56280b6 (patch)
treef32293f759952d44fd19d58b7385ad36474ffdbc
parent9eabcc653730418c9910635218c93b7fad1ecd3a (diff)
downloadsamba-9aab74eaca37b49ad9453d64ede85651f56280b6.tar.gz
samba-9aab74eaca37b49ad9453d64ede85651f56280b6.tar.xz
samba-9aab74eaca37b49ad9453d64ede85651f56280b6.zip
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. (cherry picked from commit f249d2d5893a3f8494e43fd1a805c78cee8eeec5)
-rw-r--r--source/smbd/mangle_hash.c5
1 files changed, 4 insertions, 1 deletions
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);
}
/*****************************************************************************