* autoload.cc (PrivilegeCheck): Define.

* fhandler.cc (fhandler_base::open): Always try opening with backup
	resp. restore intent.
	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Always try
	opening with backup intent.
	(fhandler_disk_file::readdir): Ditto when trying to retrieve file id
	explicitely.
	* security.cc (check_file_access): Replace pbuf with correctly
	PPRIVILEGE_SET typed pset.  Check explicitely for backup and/or restore
	privileges when AccessCheck fails, to circumvent AccessCheck
	shortcoming.  Add comment to explain.
This commit is contained in:
Corinna Vinschen
2006-10-16 12:26:59 +00:00
parent 7af26e0cc0
commit 2c1ffdbf5e
5 changed files with 71 additions and 9 deletions

View File

@ -1606,6 +1606,7 @@ fhandler_disk_file::opendir ()
SYNCHRONIZE | FILE_LIST_DIRECTORY,
&attr, &io, wincap.shared (),
FILE_SYNCHRONOUS_IO_NONALERT
| FILE_OPEN_FOR_BACKUP_INTENT
| FILE_DIRECTORY_FILE);
if (!NT_SUCCESS (status))
{
@ -1869,7 +1870,7 @@ go_ahead:
InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE,
dir->__handle , NULL);
if (!NtOpenFile (&hdl, READ_CONTROL, &attr, &io,
wincap.shared (), 0))
wincap.shared (), FILE_OPEN_FOR_BACKUP_INTENT))
{
de->d_ino = readdir_get_ino_by_handle (hdl);
CloseHandle (hdl);