chown

Corinna Vinschen vinschen@redhat.com
Fri Apr 16 21:37:00 GMT 2004


On Apr 16 10:28, Pierre A. Humblet wrote:
> Corinna Vinschen wrote:
> By getting RESTORE_NAME earlier we can avoid the fallback to 
> query_read_control.

That's done now.

> No advantage if you call CreateFile. But at that time I was still
> pursuing the idea of DuplicateHandle and I was wondering if having
> FILE_FLAG_BACKUP_SEMANTICS in the initial open was necessary. 
> MS is not clear about combinations work or don't work.

Yes, MS is not clear.  Simply scratch the rest of the sentence.

> I have now removed the test (owner != cygheap->user.sid ()) in write_sd
> and don't observe problems. NtSetSecurityObject appears to be atomic.

I've removed the test entirely.  The restore privilege is now requested
where it's really needed, always before opening the file.

I've changed fhandler_base::open to use NtCreateFile now.  After some
head scratching and searching with google, I read that the Win32 CreateFile
call adds some access bits at its own will, namely the FILE_READ_ATTRIBUTES
and SYNCHRONIZE bits.  The latter is a problem when a user has no
FILE_READ_DATA permission on a file since that apparently seem to disallow
requesting SYNCHRONIZE. 
I hope I got everything right.  I'm not sure about serial I/O, since it's
not entirely clear to me if FILE_FLAG_OVERLAPPED is simply translatable
into not setting the FILE_SYNCHRONOUS_IO_NONALERT flag.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-developers mailing list