This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Running GCC as root


On Mon, 14 Feb 2005, Ian Lance Taylor wrote:

> >  Actually gas unlinks files itself:
> 
> Well, true, but those are the error cases.  You are certainly right
> that you could unlink /dev/null by assembling an erroneous input file
> with -o /dev/null.

 That has already happened to me.  That's why we use that "-Z" option for 
Linux.

> > $ grep unlink gas/*.c
> > gas/as.c:    unlink (out_file_name);
> > gas/messages.c:    unlink (out_file_name);
> > $ 
> > 
> > The second call is the "funny" one I've mentioned -- if you have a look 
> > there, you'll know what I mean.
> 
> I think both calls are correct, actually, although perhaps they
> shouldn't unlink devices.

 Well, the second one unlinks the file unconditionally regardless of the 
"-Z" option.  But it only does it for the USE_STDARG variation; the file 
is never unlinked in the other variant of as_fatal().  That's a bit 
inconsistent.

  Maciej


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