This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: chown


At 11:37 PM 4/16/2004 +0200, Corinna Vinschen wrote:
>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.

Wow, why the change to NtCreateFile? It's unlikely to be chown/chmod.
Everything looks OK, I just have a few comments.  
- Attached is a diff that streamlines the processing on 9X and when ntsec 
is off. 
- I noticed that the fchmod method will return success even when ntea is
present and fails, but that's inherited from the old chmod.
-I don't see why it's necessary to add FILE_ATTRIBUTE_SYSTEM in the fchmod
method. It should be present already.
- The new open_9x contains ntsec related stuff that could be removed.

Pierre

Attachment: fhd.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]