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?
On Thu, Jun 21, 2012 at 4:28 AM, Hans Leidekker hans@codeweavers.com wrote:
...
This is not an atomic operation since you need two Unix calls. So you would need locking or rollback to deal with possible races.
It is my understanding that directories only support advisory locks, are you aware of a way to lock a directory?
Erich
On Thu, 2012-06-21 at 09:57 -0600, Erich E. Hoover wrote:
On Thu, Jun 21, 2012 at 4:28 AM, Hans Leidekker hans@codeweavers.com wrote:
...
This is not an atomic operation since you need two Unix calls. So you would need locking or rollback to deal with possible races.
It is my understanding that directories only support advisory locks, are you aware of a way to lock a directory?
No, I don't see a way to fix this other than adding a new primitive to the kernel.