[patch] fileio.exp FAILs if run as root
Tue Dec 11 17:54:00 GMT 2007
On Tue, 11 Dec 2007 18:13:32 +0100, Michael Snyder wrote:
> On Sat, 2007-12-08 at 20:13 +0100, Jan Kratochvil wrote:
> > On Sat, 08 Dec 2007 19:58:05 +0100, Mark Kettenis wrote:
> > > > Date: Sat, 8 Dec 2007 19:14:22 +0100
> > > > From: Jan Kratochvil <firstname.lastname@example.org>
> > > >
> > > > Hi,
> > > >
> > > > if you run gdb.base/fileio.exp as UID 0 it will print:
> > > > FAIL: gdb.base/fileio.exp: Open for write but no write permission returns EACCES
> > > > FAIL: gdb.base/fileio.exp: Unlinking a file in a directory w/o write access returns EACCES
> > >
> > > People running the testsuite as root deserve what they get. I don't
> > > think we should complicate our code to make that possible, especially
> > > if it involves calling setuid() which is notoriously unportable.
> > OK, this is the other possibility I was considering.
> Clever -- but should it be a warning instead of a terminate?
> Somebody might have a legitimate reason to run as root,
> even if we can't think of it right now.
This my patch
was more a demonstration that while running the testsuite as 'root' may be
wrong it happens and it probably should not be disabled.
This is repeating the history, warnings are not enough:
There are various warnings around, at least I see now on the console
WARNING: Couldn't find the global config file.
but apparently nobody cares (do you also see this warning?). I had to start
resolving the testsuite regression to find out the reason is the 'root' run.
I am sure I would ignore another warning message appearing during the start.
There are multiple possibilities:
(1) Keeping there setuid() before somebody complains it does not work.
(2) Pointing me/anyone at the system where this setuid() code does not work.
(3) Skipping (not FAILing) the two tests known they FAIL on the 'root' run.
(4) Disabling running the testsuite as 'root'.
(5) Giving just a warning during the start.
(6) I am too dumb to become a GDB user.
(4) and (5) are hopefully out of the question now.
More information about the Gdb-patches