From c8daf9983b445c9a2a0238af2d6e3ae23d0f3411 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 20 Apr 2004 15:51:24 +0000 Subject: * 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. --- winsup/cygwin/fhandler.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'winsup/cygwin/fhandler.cc') diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 9aa3c0d4a..1d9f42c9c 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -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); -- cgit v1.2.3