From 989fc20fc36d5a07e36e5076a5c1f351fb85d3d3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Apr 2012 15:35:55 -0700 Subject: Found whilst back-porting the fix for bug 8837 - smbd crashes when deleting directory and veto files are enabled. The delete tokens are unique to each name hash representing a pathname, if we don't correctly return here we'll add duplicate tokens for a given pasname hash. Autobuild-User: Jeremy Allison Autobuild-Date: Sat Apr 7 02:13:58 CEST 2012 on sn-devel-104 --- source3/locking/locking.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source3/locking/locking.c b/source3/locking/locking.c index cc92152727..b9afd2392c 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -934,16 +934,17 @@ void set_delete_on_close_lck(files_struct *fsp, *dt = d->delete_tokens[ d->num_delete_tokens-1]; d->num_delete_tokens -= 1; - return; + } else { + /* Replace this token with the + given tok. */ + TALLOC_FREE(dt->delete_nt_token); + dt->delete_nt_token = dup_nt_token(dt, nt_tok); + SMB_ASSERT(dt->delete_nt_token != NULL); + TALLOC_FREE(dt->delete_token); + dt->delete_token = copy_unix_token(dt, tok); + SMB_ASSERT(dt->delete_token != NULL); } - /* Replace this token with the - given tok. */ - TALLOC_FREE(dt->delete_nt_token); - dt->delete_nt_token = dup_nt_token(dt, nt_tok); - SMB_ASSERT(dt->delete_nt_token != NULL); - TALLOC_FREE(dt->delete_token); - dt->delete_token = copy_unix_token(dt, tok); - SMB_ASSERT(dt->delete_token != NULL); + return; } } -- cgit