This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: RFC: Check permissions of .gdbinit files


> Date: Tue, 31 May 2005 13:54:33 -0400
> From: Christopher Faylor <me@cgf.cx>
> 
> On Tue, May 31, 2005 at 08:46:03AM +0300, Eli Zaretskii wrote:
> >> Date: Mon, 30 May 2005 18:42:00 -0400
> >> From: Daniel Jacobowitz <drow@false.org>
> >> Cc: gdb-patches@sourceware.org
> >> 
> >> Bother; I thought about the portability for a while, but didn't quite
> >> consider this.  We're still OK though - the whole thing is surrounded
> >> by HAVE_GETUID, and MinGW does not have GETUID, if I understand
> >> correctly.
> >
> >Maybe, I don't know.  Isn't the MinGW port linked against some
> >library, such as libgw32c.a, that implements more Posix stuff?
> 
> MinGW does not have getuid().  Or, at least the version that I have
> checked out doesn't have it.  It is possible to emulate getuid on WinNT+
> and it is possible to fill in all of the fields in st_mode with
> reasonable things but, AFAIK, Mingw's implementation doesn't do this.

Yes, I agree with this analysis, provided that we talk about stock
MinGW runtime.  But if the MinGW port is built with additional
libraries, such as libgw32c, then I think it will have both getuid and
S_IWOTH, and in that case there might be a problem I mentioned above.

> >In any case, the other issue still remains: if they do have getuid and
> >S_IWOTH, non-readonly files will be reported world-writable.  So I'd
> >suggest to either disable this feature entirely on Windows platforms,
> >or write a Windows specific code that uses the Win32 API to get file
> >ownership (GetSecurityInfo or some such).
> 
> Did anyone read Ulrich Drepper's recent rant about this kind of thing?  :-)

I don't think I've read it.  I'd appreciate a URL.

> Are you implying that we should defend against the day when mingw starts
> exporting getuid?

No.  If the current MinGW build doesn't have getuid, we need not be
defensive about it, IMO.

Perhaps we should ask Mark Mitchell to try the patch on Windows and
see if there are any real problems.

In any case, I was only expressing a concern about a potential problem
which I myself cannot easily verify.  If the MinGW maintainers don't
feel these concerns are real, go ahead and forget what I said.


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