r21975: if we use the _bystring() version when storing, we should use it on fetch...
[kai/samba-autobuild/.git] / source3 / libsmb / samlogon_cache.c
index b242d0ef55b6cedbb7c05cefde4c2cd604f31e61..270ad27deb8ff72f5e74a14342211b3462d0897d 100644 (file)
@@ -181,7 +181,7 @@ BOOL netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
 NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user_sid)
 {
        NET_USER_INFO_3 *user = NULL;
-       TDB_DATA        data, key;
+       TDB_DATA        data;
        prs_struct      ps;
         fstring        keystr;
        uint32          t;
@@ -194,9 +194,7 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user
        /* Prepare key as DOMAIN-SID/USER-RID string */
        slprintf(keystr, sizeof(keystr), "%s", sid_string_static(user_sid));
        DEBUG(10,("netsamlogon_cache_get: SID [%s]\n", keystr));
-       key.dptr = keystr;
-       key.dsize = strlen(keystr)+1;
-       data = tdb_fetch( netsamlogon_tdb, key );
+       data = tdb_fetch_bystring( netsamlogon_tdb, keystr );
        
        if ( data.dptr ) {