Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Date: Thu, 1 Apr 1999 23:25:38 -0800 From: Geoffrey Noer To: anorland AT hem2 DOT passagen DOT se Cc: cygwin-developers AT sourceware DOT cygnus DOT com Subject: A new Win32 header problem Message-ID: <19990401232538.A776@cygnus.com> References: <19990331230036 DOT A3503 AT cygnus DOT com> <19990331214352 DOT A32155 AT cygnus DOT com> <3703498C DOT 72131F58 AT cityweb DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <3703498C.72131F58@cityweb.de>; from Corinna Vinschen on Thu, Apr 01, 1999 at 12:25:16PM +0200 Hi Anders, Following is a new issue with the new Win32 header files. I checked the Microsoft definitions and Microsoft defines WIN32_STREAM_ID and cStreamName the same way you have. But the sizes are off according to Corinna. Any suggestions? Thanks, Geoff On Thu, Apr 01, 1999, Corinna Vinschen wrote: [...] > Unfortunately, the new win32 header files are breaking the security features. > To try this, you may check a call to `chown()' _without_ my patch. You will > get an error message. > > In the meantime I have figured out, that the definition of WIN32_STREAM_ID > has a negative side effect. The old definition in Windows32/Structures.h was: > > typedef struct _WIN32_STREAM_ID { > DWORD dwStreamId; > DWORD dwStreamAttributes; > LARGE_INTEGER Size; > DWORD dwStreamNameSize; > WCHAR *cStreamName; > } WIN32_STREAM_ID; > > The new definition in winbase.h defines cStreamName as: > > WCHAR cStreamName[ANYSIZE_ARRAY]; // ANYSIZE_ARRAY = 1 > > In syscalls.cc(chown), the functions `BackupRead()' and `BackupWrite()' are > used to read the stream headers with the size `sizeof(header) - sizeof(header.cStreamName)' > which is 20 Bytes :) with the old headers and 22 Bytes :( with the new headers. > > After patching this, the new code is nevertheless not able, to write the new > security descriptor for the new owner with `BackupWrite()' in any case. > Strange: If I'm logged in as `administrator(500)', writing the owner sid for > `administrator(500)' or `administrators(544)' is possible, but writing a sid > for another user (e.g. `admin(1010)' which is member of `administrators(544)', too) > is impossible. > This was not the case before the winsup-version with the new windows header files! > Once again: This error happens in `chown()' _without_ my patches! > > Unfortunately, I'm not able, to work on this for at least one week. If somebody else > would be so kind, to check and, hopefully, patch this, I would be very glad. > > Best Regards, > Corinna -- Geoffrey Noer Email: noer AT cygnus DOT com Cygnus Solutions