summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/auth/auth_winbind.c3
-rw-r--r--source3/lib/talloc.c1
-rw-r--r--source3/libsmb/netlogon_unigrp.c19
-rw-r--r--source3/nsswitch/winbindd_nss.h1
-rw-r--r--source3/passdb/pdb_mysql.c3
-rw-r--r--source3/python/py_lsa.c2
-rw-r--r--source3/python/py_samr.c6
-rw-r--r--source3/python/py_smb.c4
-rw-r--r--source3/python/py_spoolss_drivers.c6
-rw-r--r--source3/python/py_spoolss_ports.c2
-rw-r--r--source3/python/py_spoolss_printers.c6
-rw-r--r--source3/rpcclient/samsync.c2
-rw-r--r--source3/utils/rpccheck.c2
13 files changed, 28 insertions, 29 deletions
diff --git a/source3/auth/auth_winbind.c b/source3/auth/auth_winbind.c
index c6a1727ebe..e45e2c879f 100644
--- a/source3/auth/auth_winbind.c
+++ b/source3/auth/auth_winbind.c
@@ -127,9 +127,8 @@ static NTSTATUS check_winbind_security(const struct auth_context *auth_context,
/* 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;
diff --git a/source3/lib/talloc.c b/source3/lib/talloc.c
index f0c13753b5..b6c8b2efdf 100644
--- a/source3/lib/talloc.c
+++ b/source3/lib/talloc.c
@@ -136,7 +136,6 @@ static TALLOC_CTX *talloc_init_internal(void)
/**
* 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, ...)
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;
}
-
diff --git a/source3/nsswitch/winbindd_nss.h b/source3/nsswitch/winbindd_nss.h
index 5c2db2ac2c..a2e4ec8f36 100644
--- a/source3/nsswitch/winbindd_nss.h
+++ b/source3/nsswitch/winbindd_nss.h
@@ -134,6 +134,7 @@ struct winbindd_request {
fstring pass;
} auth; /* pam_winbind auth module */
struct {
+ unsigned char proof[16];
unsigned char chal[8];
fstring user;
fstring domain;
diff --git a/source3/passdb/pdb_mysql.c b/source3/passdb/pdb_mysql.c
index 319bad7da2..d0f30c6394 100644
--- a/source3/passdb/pdb_mysql.c
+++ b/source3/passdb/pdb_mysql.c
@@ -1,4 +1,3 @@
-
/*
* MySQL password backend for samba
* Copyright (C) Jelmer Vernooij 2002
@@ -678,7 +677,7 @@ static NTSTATUS mysqlsam_replace_sam_account(struct pdb_methods *methods,
/* 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 =
diff --git a/source3/python/py_lsa.c b/source3/python/py_lsa.c
index d54a2289ef..31706af684 100644
--- a/source3/python/py_lsa.c
+++ b/source3/python/py_lsa.c
@@ -84,7 +84,7 @@ static PyObject *lsa_open_policy(PyObject *self, PyObject *args,
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;
}
diff --git a/source3/python/py_samr.c b/source3/python/py_samr.c
index 92a2eaf063..208274d9b5 100644
--- a/source3/python/py_samr.c
+++ b/source3/python/py_samr.c
@@ -73,7 +73,7 @@ static PyObject *samr_open_domain(PyObject *self, PyObject *args, PyObject *kw)
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;
}
@@ -167,7 +167,7 @@ static PyObject *samr_enum_dom_groups(PyObject *self, PyObject *args,
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;
}
@@ -399,7 +399,7 @@ static PyObject *samr_connect(PyObject *self, PyObject *args, PyObject *kw)
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;
diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c
index efb7d0a5fd..8d81176e4d 100644
--- a/source3/python/py_smb.c
+++ b/source3/python/py_smb.c
@@ -232,7 +232,7 @@ static PyObject *py_smb_query_secdesc(PyObject *self, PyObject *args,
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);
@@ -269,7 +269,7 @@ static PyObject *py_smb_set_secdesc(PyObject *self, PyObject *args,
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;
diff --git a/source3/python/py_spoolss_drivers.c b/source3/python/py_spoolss_drivers.c
index 6daa32d0f4..a072ac0d5c 100644
--- a/source3/python/py_spoolss_drivers.c
+++ b/source3/python/py_spoolss_drivers.c
@@ -63,7 +63,7 @@ PyObject *spoolss_enumprinterdrivers(PyObject *self, PyObject *args,
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;
@@ -267,7 +267,7 @@ PyObject *spoolss_getprinterdriverdir(PyObject *self, PyObject *args,
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;
@@ -335,7 +335,7 @@ PyObject *spoolss_addprinterdriver(PyObject *self, PyObject *args,
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;
diff --git a/source3/python/py_spoolss_ports.c b/source3/python/py_spoolss_ports.c
index 55716aca6e..ddc8868f0f 100644
--- a/source3/python/py_spoolss_ports.c
+++ b/source3/python/py_spoolss_ports.c
@@ -59,7 +59,7 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw)
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;
diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c
index a96498dddc..2076bd76cf 100644
--- a/source3/python/py_spoolss_printers.c
+++ b/source3/python/py_spoolss_printers.c
@@ -62,7 +62,7 @@ PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw)
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;
@@ -310,7 +310,7 @@ PyObject *spoolss_enumprinters(PyObject *self, PyObject *args, PyObject *kw)
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;
@@ -445,7 +445,7 @@ PyObject *spoolss_addprinterex(PyObject *self, PyObject *args, PyObject *kw)
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;
diff --git a/source3/rpcclient/samsync.c b/source3/rpcclient/samsync.c
index cbc3601812..f941d70e5e 100644
--- a/source3/rpcclient/samsync.c
+++ b/source3/rpcclient/samsync.c
@@ -373,7 +373,7 @@ static NTSTATUS sam_sync(struct cli_state *cli, unsigned char trust_passwd[16],
return result;
}
- if (!(mem_ctx = talloc_init())) {
+ if (!(mem_ctx = talloc_init("sam_sync"))) {
DEBUG(0,("talloc_init failed\n"));
return result;
}
diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c
index ab7286f8be..ae109f69b6 100644
--- a/source3/utils/rpccheck.c
+++ b/source3/utils/rpccheck.c
@@ -38,7 +38,7 @@ main()
setup_logging("", True);
DEBUGLEVEL=10;
- ctx=talloc_init();
+ ctx=talloc_init("main");
if (!ctx) exit(1);
prs_init(&ps, 1600, 4, ctx, MARSHALL);