* fhandler_disk_file.cc (fhandler_base::open_fs): Change

set_file_attribute call to indicate that NT security isn't used.
	(fhandler_disk_file::fchmod): Rearrange to isolate 9x related
	statements.
	Do not set FILE_ATTRIBUTE_SYSTEM.
	(fhandler_disk_file::fchown): Check noop case first.
	* fhandler.cc (fhandler_base::open9x): Remove ntsec related statements.
	(fhandler_base::set_name): Do not set namehash.
	* fhandler.h (fhandler_base::get_namehash): Compute and set namehash if
	needed.
	* syscalls.cc (access): Verify that fh is not NULL. Do not set PC_FULL.
	(chmod): Ditto.
	(chown_worker): Ditto.
	(stat_worker): Ditto. Verify if the path exists.
This commit is contained in:
Corinna Vinschen
2004-04-20 15:51:24 +00:00
parent 4cc12c5630
commit c8daf9983b
5 changed files with 66 additions and 46 deletions

View File

@ -152,7 +152,6 @@ fhandler_base::set_name (path_conv &in_pc)
{
memcpy (&pc, &in_pc, in_pc.size ());
pc.set_normalized_path (in_pc.normalized_path);
namehash = hash_path_name (0, get_win32_name ());
}
/* Detect if we are sitting at EOF for conditions where Windows
@ -435,7 +434,6 @@ fhandler_base::open_9x (int flags, mode_t mode)
int shared;
int creation_distribution;
SECURITY_ATTRIBUTES sa = sec_none;
security_descriptor sd;
syscall_printf ("(%s, %p)", get_win32_name (), flags);
@ -492,17 +490,12 @@ fhandler_base::open_9x (int flags, mode_t mode)
if (!(mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
file_attributes |= FILE_ATTRIBUTE_READONLY;
/* If the file should actually be created and ntsec is on,
set files attributes. */
if (flags & O_CREAT && get_device () == FH_FS && allow_ntsec && has_acls ())
set_security_attribute (mode, &sa, sd);
x = CreateFile (get_win32_name (), access, shared, &sa, creation_distribution,
file_attributes, 0);
if (x == INVALID_HANDLE_VALUE)
{
if (!wincap.can_open_directories () && pc.isdir ())
if (pc.isdir ())
{
if (flags & (O_CREAT | O_EXCL) == (O_CREAT | O_EXCL))
set_errno (EEXIST);