summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-03 10:59:18 +0100
committerVolker Lendecke <vl@samba.org>2009-11-03 11:30:00 +0100
commitb067a5e4e83556d11a68ea1837ce4698762c123d (patch)
tree89eb5bcf6046db6f478e28846ddd74e22879e2d4
parent558e2deda6798e06a6a64a25312b514566c38f66 (diff)
downloadsamba-b067a5e4e83556d11a68ea1837ce4698762c123d.tar.gz
samba-b067a5e4e83556d11a68ea1837ce4698762c123d.tar.bz2
samba-b067a5e4e83556d11a68ea1837ce4698762c123d.zip
s3: Remove debug_ctx()
smbd just crashed on me: In a debug message I called a routine preparing a string that itself used debug_ctx. The outer routine also used it after the inner routine had returned. It was still referencing the talloc context that the outer debug_ctx() had given us, which the inner DEBUG had already freed.
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/debug.c19
-rw-r--r--source3/lib/util_sid.c2
-rw-r--r--source3/libsmb/trusts_util.c2
-rw-r--r--source3/locking/brlock.c2
-rw-r--r--source3/locking/locking.c12
-rw-r--r--source3/passdb/pdb_ads.c56
-rw-r--r--source3/rpc_client/cli_pipe.c34
-rw-r--r--source3/rpc_parse/parse_prs.c2
-rw-r--r--source3/smbd/change_trust_pw.c2
-rw-r--r--source3/smbd/filename_util.c6
-rw-r--r--source3/smbd/oplock.c10
-rw-r--r--source3/smbd/oplock_onefs.c8
13 files changed, 70 insertions, 86 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 340223342a..6c8cb2e3ac 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -491,7 +491,6 @@ void check_log_size( void );
void dbgflush( void );
bool dbghdrclass(int level, int cls, const char *location, const char *func);
bool dbghdr(int level, const char *location, const char *func);
-TALLOC_CTX *debug_ctx(void);
/* The following definitions come from lib/display_sec.c */
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 2e19f89863..e851fd20e9 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -90,8 +90,6 @@ bool AllowDebugChange = True;
*/
bool override_logfile;
-static TALLOC_CTX *tmp_debug_ctx;
-
/*
* This is to allow assignment to DEBUGLEVEL before the debug
* system has been initialized.
@@ -888,8 +886,6 @@ void check_log_size( void )
}
done:
- TALLOC_FREE(tmp_debug_ctx);
-
errno = old_errno;
return( 0 );
@@ -1057,12 +1053,12 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
/* Print it all out at once to prevent split syslog output. */
if( lp_debug_prefix_timestamp() ) {
(void)Debug1( "[%s, %2d%s] ",
- current_timestring(debug_ctx(),
+ current_timestring(talloc_tos(),
lp_debug_hires_timestamp()),
level, header_str);
} else {
(void)Debug1( "[%s, %2d%s] %s(%s)\n",
- current_timestring(debug_ctx(),
+ current_timestring(talloc_tos(),
lp_debug_hires_timestamp()),
level, header_str, location, func );
}
@@ -1110,14 +1106,3 @@ bool dbghdr(int level, const char *location, const char *func)
SAFE_FREE(msgbuf);
return ret;
}
-
-/*
- * Get us a temporary talloc context usable just for DEBUG arguments
- */
-TALLOC_CTX *debug_ctx(void)
-{
- if (tmp_debug_ctx == NULL) {
- tmp_debug_ctx = talloc_named_const(NULL, 0, "debug_ctx");
- }
- return tmp_debug_ctx;
-}
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index 9e5d4d38a5..639269cac2 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -201,7 +201,7 @@ char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
char *sid_string_dbg(const DOM_SID *sid)
{
- return sid_string_talloc(debug_ctx(), sid);
+ return sid_string_talloc(talloc_tos(), sid);
}
/*****************************************************************
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 584217d3f1..5dda3c52dd 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -64,7 +64,7 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
if (NT_STATUS_IS_OK(nt_status)) {
DEBUG(3,("%s : trust_pw_change_and_store_it: Changed password.\n",
- current_timestring(debug_ctx(), False)));
+ current_timestring(talloc_tos(), False)));
/*
* Return the result of trying to write the new password
* back into the trust account file.
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 18a798182b..c72fad7f2e 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -45,7 +45,7 @@ static void print_lock_struct(unsigned int i, struct lock_struct *pls)
i,
(unsigned int)pls->context.smbpid,
(unsigned int)pls->context.tid,
- procid_str(debug_ctx(), &pls->context.pid) ));
+ procid_str(talloc_tos(), &pls->context.pid) ));
DEBUG(10,("start = %.0f, size = %.0f, fnum = %d, %s %s\n",
(double)pls->start,
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 5b17e3b6e8..cf787d4fac 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -545,9 +545,9 @@ static bool parse_share_modes(const TDB_DATA dbuf, struct share_mode_lock *lck)
DEBUG(10, ("parse_share_modes: delete_on_close: %d, owrt: %s, "
"cwrt: %s, tok: %u, num_share_modes: %d\n",
lck->delete_on_close,
- timestring(debug_ctx(),
+ timestring(talloc_tos(),
convert_timespec_to_time_t(lck->old_write_time)),
- timestring(debug_ctx(),
+ timestring(talloc_tos(),
convert_timespec_to_time_t(
lck->changed_write_time)),
(unsigned int)data.u.s.delete_token_size,
@@ -719,9 +719,9 @@ static TDB_DATA unparse_share_modes(const struct share_mode_lock *lck)
DEBUG(10,("unparse_share_modes: del: %d, owrt: %s cwrt: %s, tok: %u, "
"num: %d\n", data->u.s.delete_on_close,
- timestring(debug_ctx(),
+ timestring(talloc_tos(),
convert_timespec_to_time_t(lck->old_write_time)),
- timestring(debug_ctx(),
+ timestring(talloc_tos(),
convert_timespec_to_time_t(
lck->changed_write_time)),
(unsigned int)data->u.s.delete_token_size,
@@ -1476,7 +1476,7 @@ bool set_sticky_write_time(struct file_id fileid, struct timespec write_time)
struct share_mode_lock *lck;
DEBUG(5,("set_sticky_write_time: %s id=%s\n",
- timestring(debug_ctx(),
+ timestring(talloc_tos(),
convert_timespec_to_time_t(write_time)),
file_id_string_tos(&fileid)));
@@ -1499,7 +1499,7 @@ bool set_write_time(struct file_id fileid, struct timespec write_time)
struct share_mode_lock *lck;
DEBUG(5,("set_write_time: %s id=%s\n",
- timestring(debug_ctx(),
+ timestring(talloc_tos(),
convert_timespec_to_time_t(write_time)),
file_id_string_tos(&fileid)));
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index 70d550042b..35aadbd99f 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -358,7 +358,7 @@ static NTSTATUS pdb_ads_getsamupriv(struct pdb_ads_state *state,
&users, "%s", filter);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(result);
return NT_STATUS_LDAP(rc);
}
@@ -487,7 +487,7 @@ static NTSTATUS pdb_ads_create_user(struct pdb_methods *m,
rc = tldap_add(ld, dn, num_mods, mods, NULL, 0, NULL, 0);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_add failed %s\n",
- tldap_errstr(debug_ctx(), ld, rc)));
+ tldap_errstr(talloc_tos(), ld, rc)));
TALLOC_FREE(dn);
return NT_STATUS_LDAP(rc);
}
@@ -499,7 +499,7 @@ static NTSTATUS pdb_ads_create_user(struct pdb_methods *m,
name);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("Could not find just created user %s: %s\n",
- name, tldap_errstr(debug_ctx(), state->ld, rc)));
+ name, tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(dn);
return NT_STATUS_LDAP(rc);
}
@@ -549,7 +549,7 @@ static NTSTATUS pdb_ads_delete_user(struct pdb_methods *m,
TALLOC_FREE(dn);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_delete for %s failed: %s\n", dn,
- tldap_errstr(debug_ctx(), ld, rc)));
+ tldap_errstr(talloc_tos(), ld, rc)));
return NT_STATUS_LDAP(rc);
}
return NT_STATUS_OK;
@@ -591,7 +591,7 @@ static NTSTATUS pdb_ads_update_sam_account(struct pdb_methods *m,
TALLOC_FREE(mods);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_modify for %s failed: %s\n", priv->dn,
- tldap_errstr(debug_ctx(), ld, rc)));
+ tldap_errstr(talloc_tos(), ld, rc)));
return NT_STATUS_LDAP(rc);
}
@@ -635,7 +635,7 @@ static NTSTATUS pdb_ads_getgrfilter(struct pdb_methods *m, GROUP_MAP *map,
&group, "%s", filter);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
if (talloc_array_length(group) != 1) {
@@ -775,7 +775,7 @@ static NTSTATUS pdb_ads_create_dom_group(struct pdb_methods *m,
rc = tldap_add(ld, dn, num_mods, mods, NULL, 0, NULL, 0);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_add failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(frame);
return NT_STATUS_LDAP(rc);
}
@@ -786,7 +786,7 @@ static NTSTATUS pdb_ads_create_dom_group(struct pdb_methods *m,
"(&(objectclass=group)(samaccountname=%s))", name);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("Could not find just created alias %s: %s\n",
- name, tldap_errstr(debug_ctx(), state->ld, rc)));
+ name, tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(frame);
return NT_STATUS_LDAP(rc);
}
@@ -834,7 +834,7 @@ static NTSTATUS pdb_ads_delete_dom_group(struct pdb_methods *m,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
@@ -862,7 +862,7 @@ static NTSTATUS pdb_ads_delete_dom_group(struct pdb_methods *m,
TALLOC_FREE(msg);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_delete failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
@@ -921,7 +921,7 @@ static NTSTATUS pdb_ads_enum_group_members(struct pdb_methods *m,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
switch talloc_array_length(msg) {
@@ -983,7 +983,7 @@ static NTSTATUS pdb_ads_enum_group_memberships(struct pdb_methods *m,
priv->dn, GTYPE_SECURITY_GLOBAL_GROUP);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
@@ -1072,7 +1072,7 @@ static NTSTATUS pdb_ads_mod_groupmem(struct pdb_methods *m,
TALLOC_FREE(frame);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_modify failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
if (rc == TLDAP_TYPE_OR_VALUE_EXISTS) {
return NT_STATUS_MEMBER_IN_GROUP;
}
@@ -1146,7 +1146,7 @@ static NTSTATUS pdb_ads_create_alias(struct pdb_methods *m,
rc = tldap_add(ld, dn, num_mods, mods, NULL, 0, NULL, 0);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_add failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(frame);
return NT_STATUS_LDAP(rc);
}
@@ -1157,7 +1157,7 @@ static NTSTATUS pdb_ads_create_alias(struct pdb_methods *m,
"(&(objectclass=group)(samaccountname=%s))", name);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("Could not find just created alias %s: %s\n",
- name, tldap_errstr(debug_ctx(), state->ld, rc)));
+ name, tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(frame);
return NT_STATUS_LDAP(rc);
}
@@ -1210,7 +1210,7 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(dn);
return NT_STATUS_LDAP(rc);
}
@@ -1228,7 +1228,7 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m,
rc = tldap_delete(ld, dn, NULL, 0, NULL, 0);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_delete failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
TALLOC_FREE(dn);
return NT_STATUS_LDAP(rc);
}
@@ -1269,7 +1269,7 @@ static NTSTATUS pdb_ads_set_aliasinfo(struct pdb_methods *m,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
switch talloc_array_length(msg) {
@@ -1310,7 +1310,7 @@ static NTSTATUS pdb_ads_set_aliasinfo(struct pdb_methods *m,
TALLOC_FREE(msg);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_modify failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
return NT_STATUS_OK;
@@ -1333,7 +1333,7 @@ static NTSTATUS pdb_ads_sid2dn(struct pdb_ads_state *state,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
@@ -1406,7 +1406,7 @@ static NTSTATUS pdb_ads_mod_aliasmem(struct pdb_methods *m,
TALLOC_FREE(frame);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_modify failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
if (rc == TLDAP_TYPE_OR_VALUE_EXISTS) {
return NT_STATUS_MEMBER_IN_ALIAS;
}
@@ -1488,7 +1488,7 @@ static NTSTATUS pdb_ads_enum_aliasmem(struct pdb_methods *m,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
switch talloc_array_length(msg) {
@@ -1585,7 +1585,7 @@ static NTSTATUS pdb_ads_enum_alias_memberships(struct pdb_methods *m,
TALLOC_FREE(filter);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("tldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return NT_STATUS_LDAP(rc);
}
@@ -1658,7 +1658,7 @@ static NTSTATUS pdb_ads_lookup_rids(struct pdb_methods *m,
TALLOC_FREE(sidstr);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search failed %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
continue;
}
@@ -1797,7 +1797,7 @@ static bool pdb_ads_search_filter(struct pdb_methods *m,
"%s", filter);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("ldap_search_ext_s failed: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
return false;
}
@@ -2220,7 +2220,7 @@ static NTSTATUS pdb_ads_connect(struct pdb_ads_state *state,
rc = tldap_fetch_rootdse(ld);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("Could not retrieve rootdse: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
status = NT_STATUS_LDAP(rc);
goto done;
}
@@ -2253,7 +2253,7 @@ static NTSTATUS pdb_ads_connect(struct pdb_ads_state *state,
talloc_tos(), &domain, "(objectclass=*)");
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("Could not retrieve domain: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
status = NT_STATUS_LDAP(rc);
goto done;
}
@@ -2285,7 +2285,7 @@ static NTSTATUS pdb_ads_connect(struct pdb_ads_state *state,
talloc_tos(), &ncname, "(ncname=%s)", state->domaindn);
if (rc != TLDAP_SUCCESS) {
DEBUG(10, ("Could not retrieve ncname: %s\n",
- tldap_errstr(debug_ctx(), state->ld, rc)));
+ tldap_errstr(talloc_tos(), state->ld, rc)));
status = NT_STATUS_LDAP(rc);
goto done;
}
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index c197bd4929..e150059bcc 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -618,7 +618,7 @@ static NTSTATUS cli_pipe_verify_ntlmssp(struct rpc_pipe_client *cli, RPC_HDR *pr
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("cli_pipe_verify_ntlmssp: failed to unseal "
"packet from %s. Error was %s.\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
nt_errstr(status) ));
return status;
}
@@ -633,7 +633,7 @@ static NTSTATUS cli_pipe_verify_ntlmssp(struct rpc_pipe_client *cli, RPC_HDR *pr
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("cli_pipe_verify_ntlmssp: check signing failed on "
"packet from %s. Error was %s.\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
nt_errstr(status) ));
return status;
}
@@ -756,7 +756,7 @@ static NTSTATUS cli_pipe_verify_schannel(struct rpc_pipe_client *cli, RPC_HDR *p
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3,("cli_pipe_verify_schannel: failed to decode PDU "
"Connection to %s (%s).\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
nt_errstr(status)));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -814,7 +814,7 @@ static NTSTATUS cli_pipe_validate_rpc_response(struct rpc_pipe_client *cli, RPC_
DEBUG(3, ("cli_pipe_validate_rpc_response: "
"Connection to %s - got non-zero "
"auth len %u.\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
(unsigned int)prhdr->auth_len ));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -840,7 +840,7 @@ static NTSTATUS cli_pipe_validate_rpc_response(struct rpc_pipe_client *cli, RPC_
default:
DEBUG(3, ("cli_pipe_validate_rpc_response: Connection "
"to %s - unknown internal auth type %u.\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
cli->auth->auth_type ));
return NT_STATUS_INVALID_INFO_CLASS;
}
@@ -944,7 +944,7 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
case DCERPC_PKT_BIND_NAK:
DEBUG(1, ("cli_pipe_validate_current_pdu: Bind NACK "
"received from %s!\n",
- rpccli_pipe_txt(debug_ctx(), cli)));
+ rpccli_pipe_txt(talloc_tos(), cli)));
/* Use this for now... */
return NT_STATUS_NETWORK_ACCESS_DENIED;
@@ -965,8 +965,8 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
DEBUG(1, ("cli_pipe_validate_current_pdu: RPC fault "
"code %s received from %s!\n",
- dcerpc_errstr(debug_ctx(), NT_STATUS_V(fault_resp.status)),
- rpccli_pipe_txt(debug_ctx(), cli)));
+ dcerpc_errstr(talloc_tos(), NT_STATUS_V(fault_resp.status)),
+ rpccli_pipe_txt(talloc_tos(), cli)));
if (NT_STATUS_IS_OK(fault_resp.status)) {
return NT_STATUS_UNSUCCESSFUL;
} else {
@@ -978,14 +978,14 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
DEBUG(0, ("cli_pipe_validate_current_pdu: unknown packet type %u received "
"from %s!\n",
(unsigned int)prhdr->pkt_type,
- rpccli_pipe_txt(debug_ctx(), cli)));
+ rpccli_pipe_txt(talloc_tos(), cli)));
return NT_STATUS_INVALID_INFO_CLASS;
}
if (prhdr->pkt_type != expected_pkt_type) {
DEBUG(3, ("cli_pipe_validate_current_pdu: Connection to %s "
"got an unexpected RPC packet type - %u, not %u\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
prhdr->pkt_type,
expected_pkt_type));
return NT_STATUS_INVALID_INFO_CLASS;
@@ -1292,7 +1292,7 @@ static struct tevent_req *rpc_api_pipe_send(TALLOC_CTX *mem_ctx,
goto post_status;
}
- DEBUG(5,("rpc_api_pipe: %s\n", rpccli_pipe_txt(debug_ctx(), cli)));
+ DEBUG(5,("rpc_api_pipe: %s\n", rpccli_pipe_txt(talloc_tos(), cli)));
max_recv_frag = cli->max_recv_frag;
@@ -1338,7 +1338,7 @@ static void rpc_api_pipe_trans_done(struct tevent_req *subreq)
if (rdata == NULL) {
DEBUG(3,("rpc_api_pipe: %s failed to return data.\n",
- rpccli_pipe_txt(debug_ctx(), state->cli)));
+ rpccli_pipe_txt(talloc_tos(), state->cli)));
tevent_req_done(req);
return;
}
@@ -1406,7 +1406,7 @@ static void rpc_api_pipe_got_pdu(struct tevent_req *subreq)
*/
DEBUG(10,("rpc_api_pipe: On %s PDU data format is "
"big-endian.\n",
- rpccli_pipe_txt(debug_ctx(), state->cli)));
+ rpccli_pipe_txt(talloc_tos(), state->cli)));
prs_set_endian_data(&state->incoming_pdu, RPC_BIG_ENDIAN);
}
/*
@@ -1441,7 +1441,7 @@ static void rpc_api_pipe_got_pdu(struct tevent_req *subreq)
if (state->rhdr.flags & DCERPC_PFC_FLAG_LAST) {
DEBUG(10,("rpc_api_pipe: %s returned %u bytes.\n",
- rpccli_pipe_txt(debug_ctx(), state->cli),
+ rpccli_pipe_txt(talloc_tos(), state->cli),
(unsigned)prs_data_size(&state->incoming_pdu)));
tevent_req_done(req);
return;
@@ -2555,7 +2555,7 @@ struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
}
DEBUG(5,("Bind RPC Pipe: %s auth_type %u, auth_level %u\n",
- rpccli_pipe_txt(debug_ctx(), cli),
+ rpccli_pipe_txt(talloc_tos(), cli),
(unsigned int)auth->auth_type,
(unsigned int)auth->auth_level ));
@@ -2611,7 +2611,7 @@ static void rpc_pipe_bind_step_one_done(struct tevent_req *subreq)
TALLOC_FREE(subreq);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("rpc_pipe_bind: %s bind request returned %s\n",
- rpccli_pipe_txt(debug_ctx(), state->cli),
+ rpccli_pipe_txt(talloc_tos(), state->cli),
nt_errstr(status)));
tevent_req_nterror(req, status);
return;
@@ -2914,7 +2914,7 @@ static void rpc_bind_ntlmssp_api_done(struct tevent_req *subreq)
data_blob_free(&tmp_blob);
DEBUG(5,("rpc_finish_spnego_ntlmssp_bind: alter context request to "
- "%s.\n", rpccli_pipe_txt(debug_ctx(), state->cli)));
+ "%s.\n", rpccli_pipe_txt(talloc_tos(), state->cli)));
tevent_req_done(req);
}
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index aade037f89..673cb2593e 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -771,7 +771,7 @@ bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *st
}
DEBUGADD(5,("%s%04x %s: %s\n", tab_depth(5,depth), ps->data_offset, name,
- dcerpc_errstr(debug_ctx(), NT_STATUS_V(*status))));
+ dcerpc_errstr(talloc_tos(), NT_STATUS_V(*status))));
ps->data_offset += sizeof(uint32);
diff --git a/source3/smbd/change_trust_pw.c b/source3/smbd/change_trust_pw.c
index 72a72a78b5..ec3046e0d2 100644
--- a/source3/smbd/change_trust_pw.c
+++ b/source3/smbd/change_trust_pw.c
@@ -92,7 +92,7 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
failed:
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("%s : change_trust_account_password: Failed to change password for domain %s.\n",
- current_timestring(debug_ctx(), False), domain));
+ current_timestring(talloc_tos(), False), domain));
}
else
DEBUG(5,("change_trust_account_password: sucess!\n"));
diff --git a/source3/smbd/filename_util.c b/source3/smbd/filename_util.c
index 8c099657c4..aad8a08e2b 100644
--- a/source3/smbd/filename_util.c
+++ b/source3/smbd/filename_util.c
@@ -107,7 +107,7 @@ NTSTATUS create_synthetic_smb_fname_split(TALLOC_CTX *ctx,
}
/**
- * Return a string using the debug_ctx()
+ * Return a string using the talloc_tos()
*/
const char *smb_fname_str_dbg(const struct smb_filename *smb_fname)
{
@@ -117,7 +117,7 @@ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname)
if (smb_fname == NULL) {
return "";
}
- status = get_full_smb_filename(debug_ctx(), smb_fname, &fname);
+ status = get_full_smb_filename(talloc_tos(), smb_fname, &fname);
if (!NT_STATUS_IS_OK(status)) {
return "";
}
@@ -125,7 +125,7 @@ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname)
}
/**
- * Return a debug string using the debug_ctx(). This can only be called from
+ * Return a debug string using the talloc_tos(). This can only be called from
* DEBUG() macros due to the debut_ctx().
*/
const char *fsp_str_dbg(const struct files_struct *fsp)
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index dd8d5372fb..cdb6093fe9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -433,7 +433,7 @@ void process_oplock_async_level2_break_message(struct messaging_context *msg_ctx
message_to_share_mode_entry(&msg, (char *)data->data);
DEBUG(10, ("Got oplock async level 2 break message from pid %s: "
- "%s/%lu\n", procid_str(debug_ctx(), &src),
+ "%s/%lu\n", procid_str(talloc_tos(), &src),
file_id_string_tos(&msg.id), msg.share_file_id));
fsp = initial_break_processing(msg.id, msg.share_file_id);
@@ -478,7 +478,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
message_to_share_mode_entry(&msg, (char *)data->data);
DEBUG(10, ("Got oplock break message from pid %s: %s/%lu\n",
- procid_str(debug_ctx(), &src), file_id_string_tos(&msg.id),
+ procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
msg.share_file_id));
fsp = initial_break_processing(msg.id, msg.share_file_id);
@@ -586,7 +586,7 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx,
file_id = (unsigned long)IVAL(data->data, 24);
DEBUG(10, ("Got kernel oplock break message from pid %s: %s/%u\n",
- procid_str(debug_ctx(), &src), file_id_string_tos(&id),
+ procid_str(talloc_tos(), &src), file_id_string_tos(&id),
(unsigned int)file_id));
fsp = initial_break_processing(id, file_id);
@@ -682,7 +682,7 @@ static void process_oplock_break_response(struct messaging_context *msg_ctx,
message_to_share_mode_entry(&msg, (char *)data->data);
DEBUG(10, ("Got oplock break response from pid %s: %s/%lu mid %u\n",
- procid_str(debug_ctx(), &src), file_id_string_tos(&msg.id),
+ procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
msg.share_file_id, (unsigned int)msg.op_mid));
/* Here's the hack from open.c, store the mid in the 'port' field */
@@ -711,7 +711,7 @@ static void process_open_retry_message(struct messaging_context *msg_ctx,
message_to_share_mode_entry(&msg, (char *)data->data);
DEBUG(10, ("Got open retry msg from pid %s: %s mid %u\n",
- procid_str(debug_ctx(), &src), file_id_string_tos(&msg.id),
+ procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
(unsigned int)msg.op_mid));
schedule_deferred_open_smb_message(msg.op_mid);
diff --git a/source3/smbd/oplock_onefs.c b/source3/smbd/oplock_onefs.c
index 4a9efe6929..c80925ced3 100644
--- a/source3/smbd/oplock_onefs.c
+++ b/source3/smbd/oplock_onefs.c
@@ -67,22 +67,22 @@ const char *onefs_cb_record_str_dbg(const struct onefs_callback_record *r)
char *result;
if (r == NULL) {
- result = talloc_strdup(debug_ctx(), "NULL callback record");
+ result = talloc_strdup(talloc_tos(), "NULL callback record");
return result;
}
switch (r->state) {
case ONEFS_OPEN_FILE:
- result = talloc_asprintf(debug_ctx(), "cb record %llu for "
+ result = talloc_asprintf(talloc_tos(), "cb record %llu for "
"file %s", r->id,
fsp_str_dbg(r->data.fsp));
case ONEFS_WAITING_FOR_OPLOCK:
- result = talloc_asprintf(debug_ctx(), "cb record %llu for "
+ result = talloc_asprintf(talloc_tos(), "cb record %llu for "
"pending mid %d", r->id,
(int)r->data.mid);
break;
default:
- result = talloc_asprintf(debug_ctx(), "cb record %llu unknown "
+ result = talloc_asprintf(talloc_tos(), "cb record %llu unknown "
"state %d", r->id, r->state);
break;
}