summaryrefslogtreecommitdiff
path: root/source3/libsmb/samlogon_cache.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-15 22:00:39 +0100
committerVolker Lendecke <vl@samba.org>2007-12-15 22:09:37 +0100
commit14ef4cdec1ab6be55c97d0f32780cbddbcdde218 (patch)
treee7cb94297496f758a7935aaec62c7dd772e96f3a /source3/libsmb/samlogon_cache.c
parentd899b8c56ad6556baf2d2374704cc8cd1b15d5ad (diff)
downloadsamba-14ef4cdec1ab6be55c97d0f32780cbddbcdde218.tar.gz
Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is still far better than a static one. (This used to be commit c7c885078be8fd3024c186044ac28275d7609679)
Diffstat (limited to 'source3/libsmb/samlogon_cache.c')
-rw-r--r--source3/libsmb/samlogon_cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index b1d6c8d8f3d..a15a3b228d6 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -107,7 +107,7 @@ void netsamlogon_clear_cached_user(TDB_CONTEXT *tdb, NET_USER_INFO_3 *user)
bool netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
{
TDB_DATA data;
- fstring keystr;
+ fstring keystr, tmp;
prs_struct ps;
bool result = False;
DOM_SID user_sid;
@@ -124,7 +124,7 @@ bool netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
sid_append_rid( &user_sid, user->user_rid );
/* Prepare key as DOMAIN-SID/USER-RID string */
- slprintf(keystr, sizeof(keystr), "%s", sid_string_static(&user_sid));
+ slprintf(keystr, sizeof(keystr), "%s", sid_to_string(tmp, &user_sid));
DEBUG(10,("netsamlogon_cache_store: SID [%s]\n", keystr));
@@ -177,7 +177,7 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user
NET_USER_INFO_3 *user = NULL;
TDB_DATA data;
prs_struct ps;
- fstring keystr;
+ fstring keystr, tmp;
uint32 t;
if (!netsamlogon_cache_init()) {
@@ -186,7 +186,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));
+ slprintf(keystr, sizeof(keystr), "%s", sid_to_string(tmp, user_sid));
DEBUG(10,("netsamlogon_cache_get: SID [%s]\n", keystr));
data = tdb_fetch_bystring( netsamlogon_tdb, keystr );