From 44732734cca2328a8aceb2db9b577c923920f644 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 25 Jan 2011 14:23:19 -0800 Subject: Fix bug #7863 - Unlink may unlink wrong file when hardlinks are involved. Do this by keeping a linked list of delete on close tokens, one for each filename that identifies a path to the dev/inode. Use the jenkins hash of the pathname to identify the correct token. --- source3/smbd/smb2_getinfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/smbd/smb2_getinfo.c') diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c index 0ff659346e..e6bf893ac2 100644 --- a/source3/smbd/smb2_getinfo.c +++ b/source3/smbd/smb2_getinfo.c @@ -320,7 +320,8 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx, fileid = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st); - get_file_infos(fileid, 0, &delete_pending, &write_time_ts); + get_file_infos(fileid, fsp->name_hash, + &delete_pending, &write_time_ts); } else { /* * Original code - this is an open file. @@ -336,7 +337,8 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx, } fileid = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st); - get_file_infos(fileid, 0, &delete_pending, &write_time_ts); + get_file_infos(fileid, fsp->name_hash, + &delete_pending, &write_time_ts); } status = smbd_do_qfilepathinfo(conn, state, -- cgit