From 0175b5311e921ddfb5f246eacc5c7c5e3b426e1b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 11 May 2004 15:39:50 +0000 Subject: [PATCH] * fhandler.cc (fhandler_base::open): Set file attributes to correct value when creating files. * path.h (class path_conv): Add write accessor for file_attributes. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/fhandler.cc | 2 ++ winsup/cygwin/path.h | 1 + 3 files changed, 9 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 97a7c3899..885221db6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2004-05-10 Corinna Vinschen + + * fhandler.cc (fhandler_base::open): Set file attributes to correct + value when creating files. + * path.h (class path_conv): Add write accessor for file_attributes. + 2004-05-10 Corinna Vinschen * fhandler.h (class fhandler_socket): Add "owner" status flag. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index ae9bd8a04..bcc43074a 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -631,6 +631,8 @@ fhandler_base::open (int flags, mode_t mode) set_security_attribute (mode, &sa, sd); attr.SecurityDescriptor = sa.lpSecurityDescriptor; } + /* The file attributes are needed for later use in, e.g. fchmod. */ + pc.file_attributes (file_attributes); } status = NtCreateFile (&x, access, &attr, &io, NULL, file_attributes, shared, diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index c04366014..396749b0f 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -201,6 +201,7 @@ class path_conv DWORD get_devn () {return dev.devn;} short get_unitn () {return dev.minor;} DWORD file_attributes () {return fileattr;} + void file_attributes (DWORD new_attr) {fileattr = new_attr;} DWORD drive_type () {return fs.drive_type ();} DWORD fs_flags () {return fs.flags ();} bool fs_has_ea () {return fs.has_ea ();}