/* module initialisation */
NTSTATUS auth_init_winbind(struct auth_context *auth_context, const char *param, auth_methods **auth_method)
{
- if (!make_auth_methods(auth_context, auth_method)) {
+ if (!make_auth_methods(auth_context, auth_method))
return NT_STATUS_NO_MEMORY;
- }
(*auth_method)->name = "winbind";
(*auth_method)->auth = check_winbind_security;
/**
* Create a new talloc context, with a name specifying its purpose.
- * Please call this in preference to talloc_init().
**/
TALLOC_CTX *talloc_init(char const *fmt, ...)
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;
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 */
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 */
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;
}
/*
}
/* 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;
}
-
/* I know this is somewhat overkill but only the talloc
* functions have asprint_append and the 'normal' asprintf
* is a GNU extension */
- query.mem_ctx = talloc_init();
+ query.mem_ctx = talloc_init("mysqlsam_replace_sam_account");
query.part2 = talloc_asprintf(query.mem_ctx, "%s", "");
if (query.update) {
query.part1 =
return NULL;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("lsa_open_policy"))) {
PyErr_SetString(lsa_error, "unable to init talloc context\n");
goto done;
}
return NULL;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("samr_open_domain"))) {
PyErr_SetString(samr_error, "unable to init talloc context");
return NULL;
}
args, kw, "", kwlist))
return NULL;
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("samr_enum_dom_groups"))) {
PyErr_SetString(samr_error, "unable to init talloc context");
return NULL;
}
return NULL;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("samr_connect"))) {
PyErr_SetString(samr_ntstatus,
"unable to init talloc context\n");
goto done;
args, kw, "i", kwlist, &fnum))
return NULL;
- mem_ctx = talloc_init();
+ mem_ctx = talloc_init("py_smb_query_secdesc");
secdesc = cli_query_secdesc(cli->cli, fnum, mem_ctx);
static char *kwlist[] = { "fnum", "security_descriptor", NULL };
PyObject *py_secdesc;
SEC_DESC *secdesc;
- TALLOC_CTX *mem_ctx = talloc_init();
+ TALLOC_CTX *mem_ctx = talloc_init("py_smb_set_secdesc");
int fnum;
BOOL result;
goto done;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_enumprinterdrivers"))) {
PyErr_SetString(
spoolss_error, "unable to init talloc context\n");
goto done;
goto done;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_getprinterdriverdir"))) {
PyErr_SetString(
spoolss_error, "unable to init talloc context\n");
goto done;
return NULL;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_addprinterdriver"))) {
PyErr_SetString(
spoolss_error, "unable to init talloc context\n");
return NULL;
goto done;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_enumports"))) {
PyErr_SetString(
spoolss_error, "unable to init talloc context\n");
goto done;
goto done;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_openprinter"))) {
PyErr_SetString(spoolss_error,
"unable to init talloc context\n");
goto done;
goto done;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_enumprinters"))) {
PyErr_SetString(
spoolss_error, "unable to init talloc context\n");
goto done;
goto done;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("spoolss_addprinterex"))) {
PyErr_SetString(
spoolss_error, "unable to init talloc context\n");
goto done;
return result;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("sam_sync"))) {
DEBUG(0,("talloc_init failed\n"));
return result;
}
NTSTATUS gums_create_object(GUMS_OBJECT **obj, uint32 type)
{
- TALLOC_CTX *mem_ctx = talloc_init();
+ TALLOC_CTX *mem_ctx = talloc_init("gums_create_object");
GUMS_OBJECT *go;
NT_STATUS ret;
if (mem_ctx == NULL) {
/* Create mem_ctx */
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("do_cmd"))) {
DEBUG(0, ("talloc_init() failed\n"));
goto done;
}
setup_logging("", True);
DEBUGLEVEL=10;
- ctx=talloc_init();
+ ctx=talloc_init("main");
if (!ctx) exit(1);
prs_init(&ps, 1600, 4, ctx, MARSHALL);