Only use O_EXCL if mounting r/w.
parent
3420b5faec
commit
e5a3006f47
|
@ -524,7 +524,7 @@ typedef enum {
|
|||
* unistr.c::ntfs_collate_names() and unistr.c::legal_ansi_char_array[]
|
||||
* for what I mean but COLLATION_UNICODE_STRING would not give any special
|
||||
* treatment to any characters at all, but this is speculation.
|
||||
* COLLATION_NTOFS_ULONG - Sorting is done according to ascending u32 key
|
||||
* COLLATION_NTOFS_ULONG - Sorting is done according to ascending u32 key
|
||||
* values. E.g. used for $SII index in FILE_Secure, which sorts by
|
||||
* security_id (u32).
|
||||
* COLLATION_NTOFS_SID - Sorting is done according to ascending SID values.
|
||||
|
|
|
@ -90,9 +90,11 @@ static int ntfs_device_unix_io_open(struct ntfs_device *dev, int flags)
|
|||
return -1;
|
||||
/*
|
||||
* Open the device/file obtaining the file descriptor for exclusive
|
||||
* access.
|
||||
* access (but only if mounting r/w).
|
||||
*/
|
||||
*(int*)dev->d_private = open(dev->d_name, flags | O_EXCL);
|
||||
if ((flags & O_RDWR) == O_RDWR)
|
||||
flags |= O_EXCL;
|
||||
*(int*)dev->d_private = open(dev->d_name, flags);
|
||||
if (*(int*)dev->d_private == -1) {
|
||||
err = errno;
|
||||
goto err_out;
|
||||
|
|
Loading…
Reference in New Issue