summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-23 23:53:56 +0000
committerJeremy Allison <jra@samba.org>2002-12-23 23:53:56 +0000
commit0fdf60f0512f1a4443e315d764d59636c2075fe7 (patch)
tree4fa8b751ad63a6ffaf2046081edf63d3963df420 /source3/libsmb
parent54af5d0f252739240b933b61dffda445d1ca1337 (diff)
downloadsamba-0fdf60f0512f1a4443e315d764d59636c2075fe7.tar.gz
samba-0fdf60f0512f1a4443e315d764d59636c2075fe7.tar.bz2
samba-0fdf60f0512f1a4443e315d764d59636c2075fe7.zip
Finish adding strings to all talloc_init() calls.
Jeremy. (This used to be commit 784d15761c3271bfd602866f8f9f880dac77671c)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/netlogon_unigrp.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/libsmb/netlogon_unigrp.c b/source3/libsmb/netlogon_unigrp.c
index ea9e790b7d..fa2fe32f35 100644
--- a/source3/libsmb/netlogon_unigrp.c
+++ b/source3/libsmb/netlogon_unigrp.c
@@ -47,7 +47,7 @@ BOOL uni_group_cache_init(void)
return (netlogon_unigrp_tdb != NULL);
}
-void uni_group_cache_store_netlogon(TALLOC_CTX *mem_ctx, NET_USER_INFO_3 *user)
+BOOL uni_group_cache_store_netlogon(TALLOC_CTX *mem_ctx, NET_USER_INFO_3 *user)
{
TDB_DATA key,data;
fstring keystr;
@@ -55,7 +55,7 @@ void uni_group_cache_store_netlogon(TALLOC_CTX *mem_ctx, NET_USER_INFO_3 *user)
if (!uni_group_cache_init()) {
DEBUG(0,("uni_group_cache_store_netlogon: cannot open netlogon_unigrp.tdb for write!\n"));
- return;
+ return False;
}
/* Prepare key as DOMAIN-SID/USER-RID string */
@@ -70,7 +70,7 @@ void uni_group_cache_store_netlogon(TALLOC_CTX *mem_ctx, NET_USER_INFO_3 *user)
if(!data.dptr) {
DEBUG(0,("uni_group_cache_store_netlogon: cannot allocate memory!\n"));
talloc_destroy(mem_ctx);
- return;
+ return False;
}
/* Store data in byteorder-independent format */
@@ -78,7 +78,9 @@ void uni_group_cache_store_netlogon(TALLOC_CTX *mem_ctx, NET_USER_INFO_3 *user)
for(i=1; i<=user->num_groups2; i++) {
SIVAL(&((uint32*)data.dptr)[i],0,user->gids[i-1].g_rid);
}
- tdb_store(netlogon_unigrp_tdb, key, data, TDB_REPLACE);
+ if (tdb_store(netlogon_unigrp_tdb, key, data, TDB_REPLACE) == -1)
+ return False;
+ return True;
}
/*
@@ -149,10 +151,9 @@ uint32* uni_group_cache_fetch(DOM_SID *domain, uint32 user_rid,
}
/* Shutdown netlogon_unigrp database */
-void uni_group_cache_shutdown(void)
+BOOL uni_group_cache_shutdown(void)
{
- if(netlogon_unigrp_tdb) {
- tdb_close(netlogon_unigrp_tdb);
- }
+ if(netlogon_unigrp_tdb)
+ return (tdb_close(netlogon_unigrp_tdb) == 0);
+ return True;
}
-