On Wed, 2012-06-20 at 17:26 -0600, Erich E. Hoover wrote:
- TRACE("Linking %s to %s\n", unix_src.Buffer, unix_dest.Buffer);
- if (rmdir( unix_src.Buffer ) < 0)
- {
status = FILE_GetNtStatus();
goto cleanup;
- }
- if (symlink( unix_dest.Buffer, unix_src.Buffer ) < 0)
- {
status = FILE_GetNtStatus();
goto cleanup;
- }
- status = STATUS_SUCCESS;
This is not an atomic operation since you need two Unix calls. So you would need locking or rollback to deal with possible races.
Should permissions and ownership be preserved on the directory when a junction is removed?