The branch, v3-6-test has been updated
       via  11a258d s3: Use jenkins hash for str_checksum, fix bug 8010
      from  d46bcbc libwbclient: CID 2199 -- NULL pointer return

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 11a258dead7204a04e24badf51d3937443a1eeb3
Author: Volker Lendecke <[email protected]>
Date:   Tue Mar 15 09:30:22 2011 +0100

    s3: Use jenkins hash for str_checksum, fix bug 8010
    
    From the bugreport:
    
    I have a folder with ~90 photos: IMG_XXXX.JPG where XXXX is a four digit
    number, almost consecutive (photos from camera for one day).
    Current implementation gives about 30 different checksums for this set of
    files.

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/util.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/util.c b/source3/lib/util.c
index d5b20fa..7ae9944 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1899,17 +1899,8 @@ const char *tab_depth(int level, int depth)
 
 int str_checksum(const char *s)
 {
-       int res = 0;
-       int c;
-       int i=0;
-
-       while(*s) {
-               c = *s;
-               res ^= (c << (i % 15)) ^ (c >> (15-(i%15)));
-               s++;
-               i++;
-       }
-       return(res);
+       TDB_DATA key = string_tdb_data(s);
+       return tdb_jenkins_hash(&key);
 }
 
 /*****************************************************************


-- 
Samba Shared Repository

Reply via email to