summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/Makefile.in2
-rw-r--r--source3/libsmb/smb_share_modes.c6
-rwxr-xr-xsource3/wscript_build1
3 files changed, 4 insertions, 5 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 9dd0a45c42..5b36fe2533 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -2584,7 +2584,7 @@ showlibs:: showlibsmbclient
#
#-------------------------------------------------------------------
-LIBSMBSHAREMODES_OBJ0 = libsmb/smb_share_modes.o
+LIBSMBSHAREMODES_OBJ0 = libsmb/smb_share_modes.o ../lib/ccan/hash/hash.o
LIBSMBSHAREMODES_OBJ = $(LIBSMBSHAREMODES_OBJ0)
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;
}
diff --git a/source3/wscript_build b/source3/wscript_build
index df38e4c9db..1aefad0b67 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -684,6 +684,7 @@ bld.SAMBA3_LIBRARY('libsmb/smbclient',
bld.SAMBA3_LIBRARY('smbsharemodes',
source=LIBSMBSHAREMODES_SRC,
public_deps='''talloc tdb''',
+ deps='''ccan''',
public_headers='include/smb_share_modes.h',
vnum='0',
vars=locals())