This is the mail archive of the mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: More console changes

Geoffrey Noer wrote:
> On Wed, Mar 31, 1999, Chris Faylor wrote:
> >
> > The biggest patch coming that hasn't been committed
> > is Corinna's security patch.  I hope that we can have that in within a
> > week, assuming that it is working ok?
> >
> > Has anyone tried Corinna's patch?
> Yes.  I ran into some problems (subprocesses started in bash without
> additional cygwin options turned on yielded internal Cygwin errors).
> But I've been totally swamped and haven't had time to pursue fixing
> them or getting Corinna to fix them.
> In the interest of getting things done, I suggest someone else take
> this over.  I've appended the final patch against the current
> development sources.
> -- 
> Geoffrey Noer           Email:
> Cygnus Solutions

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;

The new definition in winbase.h defines cStreamName as:

	        WCHAR cStreamName[ANYSIZE_ARRAY];  // ANYSIZE_ARRAY = 1

In, 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,