From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17488 invoked by alias); 31 May 2005 05:46:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17428 invoked by uid 22791); 31 May 2005 05:46:45 -0000 Received: from romy.inter.net.il (HELO romy.inter.net.il) (192.114.186.66) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 31 May 2005 05:46:45 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-201-155.inter.net.il [83.130.201.155]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id BJV92908 (AUTH halo1); Tue, 31 May 2005 08:46:04 +0300 (IDT) Date: Tue, 31 May 2005 13:52:00 -0000 Message-Id: From: Eli Zaretskii To: gdb-patches@sourceware.org In-reply-to: <20050530224200.GB2727@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 30 May 2005 18:42:00 -0400) Subject: Re: RFC: Check permissions of .gdbinit files Reply-to: Eli Zaretskii References: <20050530185201.GA29332@nevyn.them.org> <20050530224200.GB2727@nevyn.them.org> X-SW-Source: 2005-05/txt/msg00660.txt.bz2 > Date: Mon, 30 May 2005 18:42:00 -0400 > From: Daniel Jacobowitz > 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? 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). > > > + error (_("source command requires pathname of file to source.")); > > > > I think the message text should begin with a capital letter (yes, I > > know the original didn't do it, either). > > I was pretty sure that the convention was lowercase letter, and no > trailing period. But I don't think this is documented anywhere, and > the source is wildly inconsistent. I could easily be remembering wrong > :-) I'm not aware of any such conventions. Starting a sentence with a capital letter sounds like the right choice, though. > > Could you please tell why you replaced `fopen' with `open'+`fdopen'? > > In order to have the file descriptor, for fstat. It occurs to me now > that "fileno" could be used for this; I am not sure how portable fileno > is `fileno' is defined by Posix, so we definitely can use it. > > Last, but not least: if we decide to make such a change (which to my > > HO sounds like a good idea, in general), we should describe this > > subtlety (and the warning it could produce) in the user's manual. > > Where would you suggest? Ah, never mind, I see there is a section on > .gdbinit already. Right.