* path.h (path_conv::init_reopen_attr): Change from void to returning

POBJECT_ATTRIBUTES.  Take OBJECT_ATTRIBUTES reference as argument, not
	pointer.
	* fhandler_disk_file.cc: Throughout accommodate above change.
	* syscalls.cc: Ditto.
	* ntea.cc (read_ea): Don't set hdl to NULL if it's already NULL.  Set
	attr with pc.init_reopen_attr before trying to reopen file.
	(write_ea): Ditto.
	* security.cc (get_file_sd): Use pc.init_reopen_attr rather than
	pc.get_object_attr when trying to reopen file.
	(set_file_sd): Ditto.
This commit is contained in:
Corinna Vinschen
2014-08-26 20:47:46 +00:00
parent 12b244394c
commit dc847e6b9e
6 changed files with 36 additions and 21 deletions

View File

@@ -672,9 +672,9 @@ fhandler_base::fstat_helper (struct stat *buf, DWORD nNumberOfLinks)
/* We have to re-open the file. Either the file is not opened
for reading, or the read will change the file position of the
original handle. */
pc.init_reopen_attr (&attr, h);
status = NtOpenFile (&h, SYNCHRONIZE | FILE_READ_DATA,
&attr, &io, FILE_SHARE_VALID_FLAGS,
pc.init_reopen_attr (attr, h), &io,
FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT
| FILE_SYNCHRONOUS_IO_NONALERT);
if (!NT_SUCCESS (status))
@@ -894,9 +894,9 @@ fhandler_disk_file::fchmod (mode_t mode)
OBJECT_ATTRIBUTES attr;
HANDLE fh;
pc.init_reopen_attr (&attr, get_handle ());
if (NT_SUCCESS (NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES, &attr, &io,
FILE_SHARE_VALID_FLAGS,
if (NT_SUCCESS (NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES,
pc.init_reopen_attr (attr, get_handle ()),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT)))
{
NtSetAttributesFile (fh, pc.file_attributes ());
@@ -1384,9 +1384,9 @@ fhandler_base::utimens_fs (const struct timespec *tvp)
OBJECT_ATTRIBUTES attr;
HANDLE fh;
pc.init_reopen_attr (&attr, get_handle ());
if (NT_SUCCESS (NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES, &attr, &io,
FILE_SHARE_VALID_FLAGS,
if (NT_SUCCESS (NtOpenFile (&fh, FILE_WRITE_ATTRIBUTES,
pc.init_reopen_attr (attr, get_handle ()),
&io, FILE_SHARE_VALID_FLAGS,
FILE_OPEN_FOR_BACKUP_INTENT)))
{
NtSetInformationFile (fh, &io, &fbi, sizeof fbi,
@@ -1555,8 +1555,8 @@ fhandler_disk_file::prw_open (bool write)
/* First try to open with the original access mask */
ACCESS_MASK access = get_access ();
pc.init_reopen_attr (&attr, get_handle ());
status = NtOpenFile (&prw_handle, access, &attr, &io,
status = NtOpenFile (&prw_handle, access,
pc.init_reopen_attr (attr, get_handle ()), &io,
FILE_SHARE_VALID_FLAGS, get_options ());
if (status == STATUS_ACCESS_DENIED)
{