summaryrefslogtreecommitdiff
path: root/source3/libsmb/samlogon_cache.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-11-11 03:03:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:23 -0500
commita4d729bdfadfc39fece612fcdd68955c3e3845bb (patch)
tree8e7521b4ae5a1db522af13ca3ed6897b2383c52d /source3/libsmb/samlogon_cache.c
parent2a7ce639eba133020dc8cbb1346e7d0a53c31a21 (diff)
downloadsamba-a4d729bdfadfc39fece612fcdd68955c3e3845bb.tar.gz
samba-a4d729bdfadfc39fece612fcdd68955c3e3845bb.tar.bz2
samba-a4d729bdfadfc39fece612fcdd68955c3e3845bb.zip
r11661: Store the INFO3 in the PAC data into the netsamlogon_cache.
Also remove the mem_ctx from the netsamlogon_cache_store() API. Guenther, what should we be doing with the other fields in the PAC_LOGON_INFO? (This used to be commit 8bead2d2825015fe41ba7d7401a12c06c29ea7f7)
Diffstat (limited to 'source3/libsmb/samlogon_cache.c')
-rw-r--r--source3/libsmb/samlogon_cache.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index ceb7b7c35a..d0469a1a48 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -109,7 +109,7 @@ void netsamlogon_clear_cached_user(TDB_CONTEXT *tdb, NET_USER_INFO_3 *user)
username should be in UTF-8 format
***********************************************************************/
-BOOL netsamlogon_cache_store(TALLOC_CTX *mem_ctx, const char * username, NET_USER_INFO_3 *user)
+BOOL netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
{
TDB_DATA data;
fstring keystr;
@@ -117,6 +117,7 @@ BOOL netsamlogon_cache_store(TALLOC_CTX *mem_ctx, const char * username, NET_USE
BOOL result = False;
DOM_SID user_sid;
time_t t = time(NULL);
+ TALLOC_CTX *mem_ctx;
if (!netsamlogon_cache_init()) {
@@ -142,6 +143,11 @@ BOOL netsamlogon_cache_store(TALLOC_CTX *mem_ctx, const char * username, NET_USE
/* Prepare data */
+ if ( !(mem_ctx = TALLOC_P( NULL, int )) ) {
+ DEBUG(0,("netsamlogon_cache_store: talloc() failed!\n"));
+ return False;
+ }
+
prs_init( &ps, RPC_MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL);
if ( !prs_uint32( "timestamp", &ps, 0, (uint32*)&t ) )
@@ -157,6 +163,8 @@ BOOL netsamlogon_cache_store(TALLOC_CTX *mem_ctx, const char * username, NET_USE
prs_mem_free( &ps );
}
+
+ TALLOC_FREE( mem_ctx );
return result;
}
@@ -175,7 +183,7 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user
uint32 t;
if (!netsamlogon_cache_init()) {
- DEBUG(0,("netsamlogon_cache_store: cannot open %s for write!\n", NETSAMLOGON_TDB));
+ DEBUG(0,("netsamlogon_cache_get: cannot open %s for write!\n", NETSAMLOGON_TDB));
return False;
}