diff options
author | Jeremy Allison <jra@samba.org> | 2002-12-23 23:53:56 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-12-23 23:53:56 +0000 |
commit | 0fdf60f0512f1a4443e315d764d59636c2075fe7 (patch) | |
tree | 4fa8b751ad63a6ffaf2046081edf63d3963df420 /source3 | |
parent | 54af5d0f252739240b933b61dffda445d1ca1337 (diff) | |
download | samba-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')
-rw-r--r-- | source3/auth/auth_winbind.c | 3 | ||||
-rw-r--r-- | source3/lib/talloc.c | 1 | ||||
-rw-r--r-- | source3/libsmb/netlogon_unigrp.c | 19 | ||||
-rw-r--r-- | source3/modules/mysql.c | 2 | ||||
-rw-r--r-- | source3/python/py_lsa.c | 2 | ||||
-rw-r--r-- | source3/python/py_samr.c | 6 | ||||
-rw-r--r-- | source3/python/py_smb.c | 4 | ||||
-rw-r--r-- | source3/python/py_spoolss_drivers.c | 6 | ||||
-rw-r--r-- | source3/python/py_spoolss_ports.c | 2 | ||||
-rw-r--r-- | source3/python/py_spoolss_printers.c | 6 | ||||
-rw-r--r-- | source3/rpcclient/samsync.c | 2 | ||||
-rw-r--r-- | source3/sam/gums_api.c | 2 | ||||
-rw-r--r-- | source3/torture/samtest.c | 2 | ||||
-rw-r--r-- | source3/utils/rpccheck.c | 2 |
14 files changed, 29 insertions, 30 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/modules/mysql.c b/source3/modules/mysql.c index 5516befc08..1d5819295b 100644 --- a/source3/modules/mysql.c +++ b/source3/modules/mysql.c @@ -676,7 +676,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/sam/gums_api.c b/source3/sam/gums_api.c index 0061988eea..df5faa42c1 100644 --- a/source3/sam/gums_api.c +++ b/source3/sam/gums_api.c @@ -35,7 +35,7 @@ NTSTATUS gums_get_object_type(uint32 *type, const GUMS_OBJECT *obj) 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; diff --git a/source3/torture/samtest.c b/source3/torture/samtest.c index d3268d8b5b..17444c0757 100644 --- a/source3/torture/samtest.c +++ b/source3/torture/samtest.c @@ -249,7 +249,7 @@ static NTSTATUS do_cmd(struct samtest_state *st, struct cmd_set *cmd_entry, char 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; } 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); |