NetBSD Problem Report #3517
Received: (qmail-queue invoked from smtpd); 19 Apr 1997 14:36:54 -0000
Message-Id: <199704191436.AAA09261@zen.quick.com.au>
Date: Sun, 20 Apr 1997 00:36:22 +1000 (EST)
From: "Simon J. Gerraty" <sjg@quick.com.au>
Reply-To: sjg@quick.com.au
To: gnats-bugs@gnats.netbsd.org
Subject: tn3270 should use mkstemp()
X-Send-Pr-Version: 3.95
>Number: 3517
>Category: bin
>Synopsis: shell() in tn3270, leaks memory and should use mkstemp()
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Apr 19 07:50:03 +0000 1997
>Closed-Date: Wed Apr 23 00:11:46 +0000 1997
>Last-Modified: Wed Apr 23 07:13:13 +0000 1997
>Originator: Simon J. Gerraty
>Release: April 2
>Organization:
Zen Programming...
>Environment:
System: NetBSD zen.quick.com.au 1.2D NetBSD 1.2D (ZEN) #12: Sat Apr 5 18:39:29 EST 1997 root@zen.quick.com.au:/share/usr.src/sys/arch/i386/compile/ZEN i386
>Description:
shell() in tn3270/sys_curses/system.c uses mktemp() and leaks in the
process.
>How-To-Repeat:
>Fix:
*** tn3270/sys_curses/system.c 1997/02/08 12:26:26 1.2
--- tn3270/sys_curses/system.c 1997/04/19 04:04:21
***************
*** 659,666 ****
--- 659,671 ----
/* First, create verification file. */
do {
+ #if defined(BSD4_4) || defined(__svr4__) || defined(HAVE_MKSTEMP)
+ if ((fd = mkstemp(strcpy(sockNAME, "/tmp/apiXXXXXX"))) >= 0)
+ keyname = strdup(sockNAME);
+ #else
keyname = mktemp(strdup("/tmp/apiXXXXXX"));
fd = open(keyname, O_RDWR|O_CREAT|O_EXCL, IREAD|IWRITE);
+ #endif
} while ((fd == -1) && (errno == EEXIST));
if (fd == -1) {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mikel
State-Changed-When: Wed Apr 23 00:11:46 1997
State-Changed-Why:
fixed (but somewhat differently), thanks.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.