* syscalls.cc (rename): Open file with FILE_READ_ATTRIBUTES.
This commit is contained in:
parent
58ae62fd94
commit
df70da7f6c
@ -1,3 +1,7 @@
|
|||||||
|
2010-08-25 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* syscalls.cc (rename): Open file with FILE_READ_ATTRIBUTES.
|
||||||
|
|
||||||
2010-08-24 Corinna Vinschen <corinna@vinschen.de>
|
2010-08-24 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* include/cygwin/version.h: Fix comment.
|
* include/cygwin/version.h: Fix comment.
|
||||||
|
@ -2010,10 +2010,13 @@ rename (const char *oldpath, const char *newpath)
|
|||||||
start_transaction (old_trans, trans);
|
start_transaction (old_trans, trans);
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
/* DELETE is required to rename a file. Samba (only some versions?) doesn't
|
/* DELETE is required to rename a file. At least one cifs FS (Tru64) needs
|
||||||
like the FILE_SHARE_DELETE mode if the file has the R/O attribute set
|
FILE_READ_ATTRIBUTE, otherwise the FileRenameInformation call fails with
|
||||||
and returns STATUS_ACCESS_DENIED in that case. */
|
STATUS_ACCESS_DENIED. Samba (only some versions?) doesn't like the
|
||||||
status = NtOpenFile (&fh, DELETE, oldpc.get_object_attr (attr, sec_none_nih),
|
FILE_SHARE_DELETE mode if the file has the R/O attribute set and returns
|
||||||
|
STATUS_ACCESS_DENIED in that case. */
|
||||||
|
status = NtOpenFile (&fh, DELETE | FILE_READ_ATTRIBUTES,
|
||||||
|
oldpc.get_object_attr (attr, sec_none_nih),
|
||||||
&io,
|
&io,
|
||||||
oldpc.fs_is_samba () ? FILE_SHARE_READ | FILE_SHARE_WRITE
|
oldpc.fs_is_samba () ? FILE_SHARE_READ | FILE_SHARE_WRITE
|
||||||
: FILE_SHARE_VALID_FLAGS,
|
: FILE_SHARE_VALID_FLAGS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user