diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 16:55:15 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-06-20 11:18:34 +0200 |
commit | 20687dcd7b66635f851f09c51f967e17203c8ab0 (patch) | |
tree | bfabb3d68042467d10286363154f0edc1b100d55 /source3/libsmb | |
parent | 754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e (diff) | |
download | samba-20687dcd7b66635f851f09c51f967e17203c8ab0.tar.gz samba-20687dcd7b66635f851f09c51f967e17203c8ab0.tar.bz2 samba-20687dcd7b66635f851f09c51f967e17203c8ab0.zip |
smb_share_modes: don't use tdb_jenkins_hash.
It's a nice hash, but this usage has nothing to do with TDB. So use the
Jenkins hash directly from CCAN instead (it's the same one).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/smb_share_modes.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 76e63e6968..133b5b82f0 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -28,6 +28,7 @@ #include "system/filesys.h" #include "smb_share_modes.h" #include <tdb.h> +#include <ccan/hash/hash.h> /* Database context handle. */ struct smbdb_ctx { @@ -267,7 +268,6 @@ int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx, static uint32_t smb_name_hash(const char *sharepath, const char *filename, int *err) { - TDB_DATA key; char *fullpath = NULL; size_t sharepath_size = strlen(sharepath); size_t filename_size = strlen(filename); @@ -283,9 +283,7 @@ static uint32_t smb_name_hash(const char *sharepath, const char *filename, int * fullpath[sharepath_size] = '/'; memcpy(&fullpath[sharepath_size + 1], filename, filename_size + 1); - key.dptr = (uint8_t *)fullpath; - key.dsize = strlen(fullpath) + 1; - name_hash = tdb_jenkins_hash(&key); + name_hash = hash(fullpath, strlen(fullpath) + 1, 0); free(fullpath); return name_hash; } |