summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-23 23:54:10 +0000
committerJeremy Allison <jra@samba.org>2002-12-23 23:54:10 +0000
commit98ac4503aca8f5a5a4268d89791e9a4491ce8645 (patch)
treeb2924c73e39c05a8c3bf234a677f43ef821dd4cd /source3/libsmb
parentfa997c54eb266b6203945827b332600cd58f1379 (diff)
downloadsamba-98ac4503aca8f5a5a4268d89791e9a4491ce8645.tar.gz
samba-98ac4503aca8f5a5a4268d89791e9a4491ce8645.tar.bz2
samba-98ac4503aca8f5a5a4268d89791e9a4491ce8645.zip
Finish adding strings to all talloc_init() calls.
Jeremy. (This used to be commit aa8439a49ec4b9f433745fefa1e769e45398f4df)
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;
}
-