diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-12 05:10:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:49 -0500 |
commit | 52f525c104ae2d17901f104cbf482395dc803cc1 (patch) | |
tree | 1ccd6d3879a0d82311f8796cb15e958b1e77ab5a /source4/ntvfs/posix/vfs_posix.h | |
parent | c7130b816b29cab981646482e57cb6923ae91b4f (diff) | |
download | samba-52f525c104ae2d17901f104cbf482395dc803cc1.tar.gz samba-52f525c104ae2d17901f104cbf482395dc803cc1.tar.bz2 samba-52f525c104ae2d17901f104cbf482395dc803cc1.zip |
r2927: imported the hash2 name mangling code from Samba3 into Samba4, but
heavily modified to suit the Samba4 architecture.
Samba4 with posix backend now passes the BASE-MANGLE test
(This used to be commit ed52d69e8a065b6a8df2fb73c89be67acfdbca65)
Diffstat (limited to 'source4/ntvfs/posix/vfs_posix.h')
-rw-r--r-- | source4/ntvfs/posix/vfs_posix.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h index 0daacf2c33..f6faf718be 100644 --- a/source4/ntvfs/posix/vfs_posix.h +++ b/source4/ntvfs/posix/vfs_posix.h @@ -49,6 +49,8 @@ struct pvfs_state { } search; struct pvfs_file *open_files; + + struct pvfs_mangle_context *mangle_ctx; }; @@ -115,6 +117,32 @@ struct pvfs_file { uint16_t smbpid; }; +struct pvfs_mangle_context { + uint8_t char_flags[256]; + /* + this determines how many characters are used from the original + filename in the 8.3 mangled name. A larger value leads to a weaker + hash and more collisions. The largest possible value is 6. + */ + int mangle_prefix; + uint32_t mangle_modulus; + + /* we will use a very simple direct mapped prefix cache. The big + advantage of this cache structure is speed and low memory usage + + The cache is indexed by the low-order bits of the hash, and confirmed by + hashing the resulting cache entry to match the known hash + */ + char **prefix_cache; + uint32_t *prefix_cache_hashes; + + /* this is used to reverse the base 36 mapping */ + unsigned char base_reverse[256]; + + const char **reserved_names; +}; + + /* flags to pvfs_resolve_name() */ #define PVFS_RESOLVE_NO_WILDCARD (1<<0) |