windows-del-symlink-20071021
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 22 Oct 2007 04:27:14 +0000 (04:27 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 22 Oct 2007 04:27:14 +0000 (04:27 +0000)
commitf90153625efee1e5589df5e6b66a1162e07ddbfa
treea3a135180e5739477c1f6864bc3235db3a3378a3
parent20cfc16e3d6d874a6a21f6ed68ff904dd45142d5
windows-del-symlink-20071021

The cmd.exe "del" command operates by opening a file and then setting
the file disposition to delete on close followed by closing the file.

When the filename is a symlink, the smb_fid_t scp refers to the final
destination object and not the symlink.  In smb_CloseFid() the correct
object would be removed from the directory by name, but the wrong cm_scache_t
would be marked deleted.  This would result in subsequent references to
the target file being considered invalid.

Fix it by looking up the cm_scache_t of the symlink prior to performing
the deletion.
src/WINNT/afsd/smb.c