update to ddd 3.3.1

- minor bug fixes
- improved temp file handling

from Andrew Dalgleish <openbsd@andrewdalgleish.dyndns.org>
This commit is contained in:
sturm 2003-04-10 16:51:21 +00:00
parent 8dbeb41533
commit b3e214febb
11 changed files with 56 additions and 175 deletions

View File

@ -1,13 +1,14 @@
# $OpenBSD: Makefile,v 1.34 2002/10/13 21:45:46 naddy Exp $ # $OpenBSD: Makefile,v 1.35 2003/04/10 16:51:21 sturm Exp $
COMMENT= "Data Display Debugger, graphical front-end for GDB, etc" COMMENT= "Data Display Debugger, graphical front-end for GDB, etc"
DISTNAME= ddd-3.3 DISTNAME= ddd-3.3.1
CATEGORIES= devel CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:=ddd/} MASTER_SITES= ${MASTER_SITE_GNU:=ddd/}
HOMEPAGE= http://www.gnu.org/software/ddd/ HOMEPAGE= http://www.gnu.org/software/ddd/
# GPL
PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_CDROM= Yes
@ -16,6 +17,9 @@ PERMIT_DISTFILES_FTP= Yes
USE_MOTIF= any USE_MOTIF= any
USE_GMAKE= Yes USE_GMAKE= Yes
CONFIGURE_STYLE=gnu CONFIGURE_STYLE=gnu
SUBST_VARS+= DISTNAME
MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC} ${WRKSRC}/libiberty \ MODGNU_CONFIG_GUESS_DIRS= ${WRKSRC} ${WRKSRC}/libiberty \
${WRKSRC}/readline/support ${WRKSRC}/readline/support
CONFIGURE_ARGS= --with-readline-libraries=/usr/lib CONFIGURE_ARGS= --with-readline-libraries=/usr/lib

View File

@ -1,3 +1,3 @@
MD5 (ddd-3.3.tar.gz) = 0454f8b986223168c7148a84afeb416c MD5 (ddd-3.3.1.tar.gz) = 38589618d7cd02a03d062bb116bbf1d2
RMD160 (ddd-3.3.tar.gz) = e3782a85af33100c9520d2b576c1db579349d9c3 RMD160 (ddd-3.3.1.tar.gz) = 5753988c15da13b154bd5138a21f7381906f6bce
SHA1 (ddd-3.3.tar.gz) = 889c435bed8f16cb618dc56a85be6f6384d5df24 SHA1 (ddd-3.3.1.tar.gz) = 60327a4097718acc1c095844d043dea0c14343ce

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-ddd_PlotAgent_C,v 1.1 2000/10/30 13:54:50 espie Exp $
--- ddd/PlotAgent.C.orig Mon Oct 30 14:28:07 2000
+++ ddd/PlotAgent.C Mon Oct 30 14:33:54 2000
@@ -83,11 +83,14 @@ void PlotAgent::start_plot(const string&
while (files.size() < titles.size())
{
- // Open a new temporary file
- files += tmpnam(0);
+ // Create a new temporary file
+ char temp_name[] = "/tmp/dplot.XXXXXXXXXX";
+ int temp_fd = mkstemp(temp_name);
+ close(temp_fd);
+ files += temp_name;
}
- // Open plot stream
+ // Re-Open plot stream
plot_os.open(files[titles.size() - 1]);
// Issue initial line

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-ddd_comm-manag_C,v 1.3 2002/10/13 21:45:46 naddy Exp $ $OpenBSD: patch-ddd_comm-manag_C,v 1.4 2003/04/10 16:51:21 sturm Exp $
--- ddd/comm-manag.C.orig Tue Jan 16 05:51:37 2001 --- ddd/comm-manag.C.orig Tue Mar 27 02:40:05 2001
+++ ddd/comm-manag.C Fri Oct 11 12:13:38 2002 +++ ddd/comm-manag.C Fri Mar 28 10:35:57 2003
@@ -85,6 +85,7 @@ char comm_manager_rcsid[] = @@ -86,6 +86,7 @@ char comm_manager_rcsid[] =
#include <ctype.h> #include <ctype.h>
#include <fstream.h> #include <fstream.h>
@ -9,22 +9,3 @@ $OpenBSD: patch-ddd_comm-manag_C,v 1.3 2002/10/13 21:45:46 naddy Exp $
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -800,13 +801,16 @@ void init_session(const string& restart,
info = new InitSessionInfo;
info->restart = restart;
info->settings = settings;
- info->tempfile = tmpnam(0);
+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX";
+ int temp_fd = mkstemp(temp_name);
+ info->tempfile = temp_name;
string file_commands = "set confirm off\n";
bool recording_defines = false;
{
- ofstream os(info->tempfile);
+ close(temp_fd); // hack but how to mix mkstemp & ofstream ...
+ ofstream os(info->tempfile); // without a ctor ofstream(fd) ?
while (init_commands != "")
{
string cmd = init_commands.before('\n');

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-ddd_exit_C,v 1.3 2002/10/13 21:45:46 naddy Exp $
--- ddd/exit.C.orig Tue Dec 19 08:45:49 2000
+++ ddd/exit.C Fri Oct 11 12:20:34 2002
@@ -1149,8 +1149,11 @@ void report_core(ostream& log)
if (!is_core_file("core"))
return;
- string tempfile = tmpnam(0);
- ofstream os(tempfile);
+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX";
+ int temp_fd = mkstemp(temp_name);
+ string tempfile = temp_name;
+ close(temp_fd); // hack ...
+ ofstream os(temp_name); // ... no ofstream(fd) ctor
os <<
"set verbose off\n"
"set height 0\n"

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-ddd_plotter_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $
--- ddd/plotter.C.orig Tue Jan 9 15:15:22 2001
+++ ddd/plotter.C Wed Mar 13 04:32:03 2002
@@ -429,7 +429,14 @@ static void configure_plot(PlotWindowInf
new StatusDelay("Retrieving Plot Settings");
// Save settings...
- plot->settings_file = tmpnam(0);
+ // gnuplot has no compunction about saving twice to the same
+ // file, so we can make this safe
+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX";
+ int fd = mkstemp(temp_name);
+ if (fd == 0)
+ return;
+ close(fd);
+ plot->settings_file = temp_name;
string cmd = "save " + quote(plot->settings_file) + "\n";
send(plot, cmd);

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-ddd_print_C,v 1.1 2000/10/30 13:54:51 espie Exp $
--- ddd/print.C.orig Mon Oct 30 13:36:27 2000
+++ ddd/print.C Mon Oct 30 13:39:17 2000
@@ -212,7 +212,12 @@ static void printOutputHP(Agent *, void
static int print_to_printer(string command, PrintGC& gc,
bool selectedOnly, bool displays)
{
- string tempfile = tmpnam(0);
+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX";
+ int temp_fd = mkstemp(temp_name);
+ if (temp_fd == -1)
+ return 1;
+ close(temp_fd);
+ string tempfile = temp_name;
int ret = print_to_file(tempfile, gc, selectedOnly, displays);
if (ret)
return ret;

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-ddd_show_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $ $OpenBSD: patch-ddd_show_C,v 1.3 2003/04/10 16:51:21 sturm Exp $
--- ddd/show.C.orig Tue Jan 9 15:00:51 2001 --- ddd/show.C.orig Fri Apr 27 00:17:19 2001
+++ ddd/show.C Wed Mar 13 04:32:04 2002 +++ ddd/show.C Fri Mar 28 10:35:58 2003
@@ -58,6 +58,7 @@ char show_rcsid[] = @@ -59,6 +59,7 @@ char show_rcsid[] =
#include <fstream.h> #include <fstream.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
@ -9,20 +9,3 @@ $OpenBSD: patch-ddd_show_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $
#include "Xpm.h" #include "Xpm.h"
#include "HelpCB.h" #include "HelpCB.h"
@@ -403,11 +404,14 @@ void show_configuration(ostream& os)
static int uncompress(ostream& os, const char *text, int size)
{
- string tempfile = tmpnam(0);
- FILE *fp = fopen(tempfile, "w");
+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX";
+ int temp_fd = mkstemp(temp_name);
+ string tempfile = temp_name;
+ FILE *fp = fdopen(temp_fd, "w");
if (fp == 0)
{
os << tempfile << ": " << strerror(errno);
+ close(temp_fd);
return -1;
}

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-ddd_strclass_C,v 1.1 2002/10/13 21:45:46 naddy Exp $
--- ddd/strclass.C.orig Sun Oct 13 19:56:55 2002
+++ ddd/strclass.C Sun Oct 13 19:59:42 2002
@@ -1431,7 +1431,7 @@ istream& operator>>(istream& s, string&
}
x.rep->s[i] = 0;
x.rep->len = i;
- int new_state = s.rdstate();
+ ios::iostate new_state = s.rdstate();
if (i == 0)
new_state |= ios::failbit;
if (ch == EOF)

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.6 2002/03/21 05:28:21 fgsch Exp $ @comment $OpenBSD: PLIST,v 1.7 2003/04/10 16:51:21 sturm Exp $
@unexec install-info --delete --info-dir=%D/info %D/info/ddd-themes.info @unexec install-info --delete --info-dir=%D/info %D/info/ddd-themes.info
@unexec install-info --delete --info-dir=%D/info %D/info/ddd.info @unexec install-info --delete --info-dir=%D/info %D/info/ddd.info
bin/ddd bin/ddd
@ -19,35 +19,35 @@ info/ddd.info-7
info/ddd.info-8 info/ddd.info-8
info/ddd.info-9 info/ddd.info-9
man/man1/ddd.1 man/man1/ddd.1
share/ddd-3.3/COPYING share/${DISTNAME}/COPYING
share/ddd-3.3/NEWS share/${DISTNAME}/NEWS
share/ddd-3.3/ddd/Ddd share/${DISTNAME}/ddd/Ddd
share/ddd-3.3/themes/green.vsl share/${DISTNAME}/themes/green.vsl
share/ddd-3.3/themes/red.vsl share/${DISTNAME}/themes/red.vsl
share/ddd-3.3/themes/smalltitles.vsl share/${DISTNAME}/themes/smalltitles.vsl
share/ddd-3.3/themes/smallvalues.vsl share/${DISTNAME}/themes/smallvalues.vsl
share/ddd-3.3/themes/suppress.vsl share/${DISTNAME}/themes/suppress.vsl
share/ddd-3.3/themes/tinyvalues.vsl share/${DISTNAME}/themes/tinyvalues.vsl
share/ddd-3.3/vsllib/arcs.vsl share/${DISTNAME}/vsllib/arcs.vsl
share/ddd-3.3/vsllib/builtin.vsl share/${DISTNAME}/vsllib/builtin.vsl
share/ddd-3.3/vsllib/colors.vsl share/${DISTNAME}/vsllib/colors.vsl
share/ddd-3.3/vsllib/ctree.vsl share/${DISTNAME}/vsllib/ctree.vsl
share/ddd-3.3/vsllib/ddd.vsl share/${DISTNAME}/vsllib/ddd.vsl
share/ddd-3.3/vsllib/flow.vsl share/${DISTNAME}/vsllib/flow.vsl
share/ddd-3.3/vsllib/flowplus.vsl share/${DISTNAME}/vsllib/flowplus.vsl
share/ddd-3.3/vsllib/fonts.vsl share/${DISTNAME}/vsllib/fonts.vsl
share/ddd-3.3/vsllib/linebreak.vsl share/${DISTNAME}/vsllib/linebreak.vsl
share/ddd-3.3/vsllib/list.vsl share/${DISTNAME}/vsllib/list.vsl
share/ddd-3.3/vsllib/slopes.vsl share/${DISTNAME}/vsllib/slopes.vsl
share/ddd-3.3/vsllib/std.vsl share/${DISTNAME}/vsllib/std.vsl
share/ddd-3.3/vsllib/struct.vsl share/${DISTNAME}/vsllib/struct.vsl
share/ddd-3.3/vsllib/symbols.vsl share/${DISTNAME}/vsllib/symbols.vsl
share/ddd-3.3/vsllib/tab.vsl share/${DISTNAME}/vsllib/tab.vsl
share/ddd-3.3/vsllib/tree.vsl share/${DISTNAME}/vsllib/tree.vsl
share/ddd-3.3/vsllib/verbose.vsl share/${DISTNAME}/vsllib/verbose.vsl
share/ddd-3.3/vsllib/vsl.vsl share/${DISTNAME}/vsllib/vsl.vsl
share/ddd-3.3/vsllib/vsldef.vsl share/${DISTNAME}/vsllib/vsldef.vsl
share/ddd-3.3/vsllib/vsllib.vsl share/${DISTNAME}/vsllib/vsllib.vsl
share/doc/ddd/PROBLEMS share/doc/ddd/PROBLEMS
share/doc/ddd/README share/doc/ddd/README
share/doc/ddd/ddd-paper.ps.gz share/doc/ddd/ddd-paper.ps.gz
@ -55,9 +55,9 @@ share/doc/ddd/ddd.ps.gz
share/doc/ddd/sample.c share/doc/ddd/sample.c
share/doc/ddd/sample.dddinit share/doc/ddd/sample.dddinit
@dirrm share/doc/ddd @dirrm share/doc/ddd
@dirrm share/ddd-3.3/vsllib @dirrm share/${DISTNAME}/vsllib
@dirrm share/ddd-3.3/themes @dirrm share/${DISTNAME}/themes
@dirrm share/ddd-3.3/ddd @dirrm share/${DISTNAME}/ddd
@dirrm share/ddd-3.3 @dirrm share/${DISTNAME}
@exec install-info --info-dir=%D/info %D/info/ddd-themes.info @exec install-info --info-dir=%D/info %D/info/ddd-themes.info
@exec install-info --info-dir=%D/info %D/info/ddd.info @exec install-info --info-dir=%D/info %D/info/ddd.info

View File

@ -1,7 +1,6 @@
$OpenBSD: SECURITY,v 1.1 2000/10/30 13:54:51 espie Exp $ $OpenBSD: SECURITY,v 1.2 2003/04/10 16:51:21 sturm Exp $
There are lots of tmpnam() warnings in ddd. Temporary file handling has improved in this version, but still needs
Most are temporary files that are used locally. work. It now uses mkstemp(), but because there is no way to create an
A few are passed off to an external gnuplot process. ofstream object from a file descriptor there are still race conditions.
Fortunately, gnuplot has no compunction about writing over Similarly for passing temp file names to gnuplot.
an existing file, so those can be fixed.