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 */
*/
bool override_logfile;
-static TALLOC_CTX *tmp_debug_ctx;
-
/*
* This is to allow assignment to DEBUGLEVEL before the debug
* system has been initialized.
}
done:
- TALLOC_FREE(tmp_debug_ctx);
-
errno = old_errno;
return( 0 );
/* 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 );
}
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;
-}
char *sid_string_dbg(const DOM_SID *sid)
{
- return sid_string_talloc(debug_ctx(), sid);
+ return sid_string_talloc(talloc_tos(), sid);
}
/*****************************************************************
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.
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,
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,
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,
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)));
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)));
&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);
}
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);
}
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);
}
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;
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);
}
&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) {
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);
}
"(&(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);
}
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);
}
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);
}
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) {
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);
}
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;
}
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);
}
"(&(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);
}
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);
}
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);
}
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) {
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;
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);
}
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;
}
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) {
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);
}
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;
}
"%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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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 {
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;
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;
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;
}
*/
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);
}
/*
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;
}
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 ));
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;
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);
}
}
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);
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"));
}
/**
- * 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)
{
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 "";
}
}
/**
- * 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)
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);
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);
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);
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 */
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);
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;
}