From 2e262a75cca4575edd00db3d24e7e35760943120 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Nov 2005 23:01:39 +0000 Subject: r11962: Bring talloc up to date with Samba4, re-add the talloc_describe_all() function. Fix smbcontrol pool-usage as we desparately need it working in the field to track down memory leaks. Seriously, when new functionality like the Samba4 talloc is added, don't just disable working functionality like "pool-usage", fix the damn thing first ! Jeremy. --- source/lib/tallocmsg.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source/lib/tallocmsg.c') diff --git a/source/lib/tallocmsg.c b/source/lib/tallocmsg.c index 8f03fd66ff1..b515093cd69 100644 --- a/source/lib/tallocmsg.c +++ b/source/lib/tallocmsg.c @@ -33,18 +33,23 @@ void msg_pool_usage(int msg_type, struct process_id src_pid, void *UNUSED(buf), size_t UNUSED(len)) { - off_t reply; - fstring reply_str; + char *reply = NULL; SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE); DEBUG(2,("Got POOL_USAGE\n")); - reply = talloc_total_size(NULL); - fstr_sprintf(reply_str, "%ld", (long)reply); + reply = talloc_describe_all(); + if (!reply) { + return; + } + become_root(); message_send_pid(src_pid, MSG_POOL_USAGE, - reply_str, strlen(reply_str)+1, True); + reply, strlen(reply)+1, True); + unbecome_root(); + + SAFE_FREE(reply); } /** -- cgit