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


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.

>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?  :-)

Are you implying that we should defend against the day when mingw starts
exporting getuid?  If we're postulating that getuid might exist someday
can't we just postulate that st_mode has been fixed at the same time?

cgf


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