summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-04-06 15:35:55 -0700
committerJeremy Allison <jra@samba.org>2012-04-07 02:13:58 +0200
commit989fc20fc36d5a07e36e5076a5c1f351fb85d3d3 (patch)
tree29a369767364e4c0fea8bea79e96c177e87c6b70
parenta92c532573b293f5c0ed4a386c866bc9a3dbeef3 (diff)
downloadsamba-989fc20fc36d5a07e36e5076a5c1f351fb85d3d3.tar.gz
samba-989fc20fc36d5a07e36e5076a5c1f351fb85d3d3.tar.bz2
samba-989fc20fc36d5a07e36e5076a5c1f351fb85d3d3.zip
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 <jra@samba.org> Autobuild-Date: Sat Apr 7 02:13:58 CEST 2012 on sn-devel-104
-rw-r--r--source3/locking/locking.c19
1 files 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;
}
}