r21975: if we use the _bystring() version when storing, we should use it on fetch...
authorStefan Metzmacher <metze@samba.org>
Tue, 27 Mar 2007 09:30:40 +0000 (09:30 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:54 +0000 (12:18 -0500)
metze
(This used to be commit d105723f063d617ef9f8394e7921749b21f1d755)

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 ) {