From b067a5e4e83556d11a68ea1837ce4698762c123d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 3 Nov 2009 10:59:18 +0100 Subject: 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. --- source3/locking/locking.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/locking/locking.c') 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))); -- cgit