This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] fileio.exp FAILs if run as root
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: jan dot kratochvil at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 8 Dec 2007 19:58:05 +0100 (CET)
- Subject: Re: [patch] fileio.exp FAILs if run as root
- References: <20071208181422.GA10275@host0.dyn.jankratochvil.net>
> Date: Sat, 8 Dec 2007 19:14:22 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
>
> 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.
> 2007-12-08 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * gdb.base/fileio.c (ROOTSUBDIR): New macro.
> (main): CHDIR into ROOTSUBDIR. CHOWN ROOTSUBDIR and CHDIR into
> ROOTSUBDIR if we are being run as root.
> * gdb.base/fileio.exp: Change the startup and finish cleanup.
> Change the test file reference to be into the `fileio.dir' directory.