[Patch]: Last path.cc

Corinna Vinschen vinschen@redhat.com
Tue Apr 13 20:49:00 GMT 2004

On Apr 13 14:43, Corinna Vinschen wrote:
> What I'm up to is to change all the affected functionality to what's
> already working fine in case of stat/fstat:
>   baz (char *posix_name)
>   {
>     Create fhandler
>     fhandler->fbaz (fd);
>   }
>   fbaz (int fd)
>   {
>     Get fhandler
>     fhandler->fbaz (fd);
>   }
>   fhandler::fbaz ()
>   {
>     NT_baz_equivalent (handle);
>   }

I've implemented something along these lines for fchmod so far.  Trying
to write the security attributes using NtSetSecurityObject is a dead end
though.  It requires to open the file with WRITE_DAC and WRITE_OWNER
access rights, both of which are not contained in GENERIC_READ nor in
GENERIC_WRITE.  So there's no gain in using it, unfortunately.

What I just checked in uses the open handle to read the security
attributes but still calls write_sd as before.  The interesting thing
is, that it's nevertheless faster than before, though the number of
open/close calls should be the same.

I'll try the same with chown/fchown tomorrow.

Oh, one problem left.  Currently fhandler_disk_file::fchmod calls
chmod_device which is pretty ugly.  Chris, do you have an idea how
to do that in a cleaner way?


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

More information about the Cygwin-patches mailing list