This is the mail archive of the
mailing list for the GDB project.
Re: Patch: fix gdb_gcore.sh failure in ash/dash
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: drow at false dot org
- Cc: qpan at mvista dot com, gdb-patches at sources dot redhat dot com, qunyingpan at gmail dot com
- Date: Sun, 18 Sep 2005 00:17:43 +0200 (CEST)
- Subject: Re: Patch: fix gdb_gcore.sh failure in ash/dash
- References: <432240C1.email@example.com> <20050917215830.GG8777@nevyn.them.org>
> Date: Sat, 17 Sep 2005 17:58:30 -0400
> From: Daniel Jacobowitz <firstname.lastname@example.org>
> On Fri, Sep 09, 2005 at 07:11:13PM -0700, Qunying Pan wrote:
> > Hi,
> > Running gdb_gcore.sh in ash/dash fails with message "Hangup detected on
> > fd 0". The following patch fixes the problem. Acceptable?
> Let's just use a tempfile. This patch also makes one other change in
> behavior: it uses gdb from $PATH instead of hardcoding /usr/bin, since
> I needed that to test it and it seems more reasonable.
> Anyone have comments on this patch?
I think using a temporary file is a good idea, but if I read your
patch correctly, it seems the temporary file is created in the current
directory, which might not be writable.
Another problem is that the name is predictable, which is a potential
security risk. Assuming mktemp(1) is available is probably not a good
idea, but it'd be nice to use it if it's avaiable.