From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jul 14 07:20:19 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3790C37B401 for ; Mon, 14 Jul 2003 07:20:19 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A999843FAF for ; Mon, 14 Jul 2003 07:20:18 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6EEKIUp063056 for ; Mon, 14 Jul 2003 07:20:18 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6EEKIrI063055; Mon, 14 Jul 2003 07:20:18 -0700 (PDT) Date: Mon, 14 Jul 2003 07:20:18 -0700 (PDT) Message-Id: <200307141420.h6EEKIrI063055@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Volker Stolz Subject: Re: ports/54012: [patch] devel/mk: Update to 1.4 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Volker Stolz List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2003 14:20:19 -0000 The following reply was made to PR ports/54012; it has been noted by GNATS. From: Volker Stolz To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Cc: osa@FreeBSD.org Subject: Re: ports/54012: [patch] devel/mk: Update to 1.4 Date: Mon, 14 Jul 2003 16:12:59 +0200 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 02, 2003 at 05:40:11AM -0700, FreeBSD-gnats-submit@FreeBSD.org wrote: > http://www.freebsd.org/cgi/query-pr.cgi?pr=54012 > > >Category: ports > >Responsible: freebsd-ports-bugs > >Synopsis: [patch] devel/mk: Update to 1.4 > >Arrival-Date: Wed Jul 02 05:40:11 PDT 2003 Osa@ asked me to look into the tmpnam() issue. Fix seems to have been lost in the noise. Two (new) patchfiles attached: - patch-src-main.c - patch-src-Posix.c Volker -- http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME rage against the finite state machine --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mk.1" --- src/main.c.orig Wed Jun 5 17:30:39 2002 +++ src/main.c Thu Jul 3 18:34:19 2003 @@ -33,7 +33,7 @@ main(int argc, char **argv) { Word *w; - char *s, *temp; + char *s; char *files[256], **f = files, **ff; int sflag = 0; int i; @@ -41,6 +41,8 @@ Biobuf tb; Bufblock *buf; Bufblock *whatif; + char TMPLATE[14]; + (void)strncpy(TMPLATE,"/tmp/mk.XXXXX", sizeof(TMPLATE)); /* * start with a copy of the current environment variables @@ -133,21 +135,15 @@ /* assignment args become null strings */ - temp = 0; for(i = 0; argv[i]; i++) if(utfrune(argv[i], '=')){ bufcpy(buf, argv[i], strlen(argv[i])); insert(buf, ' '); if(tfd < 0){ - temp = maketmp(); - if(temp == 0) { - perror("temp file"); - Exit(); - } - close(create(temp, OWRITE, 0600)); - if((tfd = open(temp, 2)) < 0){ - perror(temp); + if ((tfd = mkstemp(TMPLATE)) < 0){ + perror(TMPLATE); Exit(); } + unlink(TMPLATE); Binit(&tb, tfd, OWRITE); } Bprint(&tb, "%s\n", argv[i]); @@ -157,7 +153,6 @@ Bflush(&tb); LSEEK(tfd, 0L, 0); parse("command line args", tfd, 1); - remove(temp); } if (buf->current != buf->start) { --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mk.2" --- src/Posix.c.orig Thu Jul 3 16:08:16 2003 +++ src/Posix.c Thu Jul 3 16:08:31 2003 @@ -276,14 +276,6 @@ signal(sigmsgs[i].sig, notifyf); } -char* -maketmp(void) -{ - static char temp[L_tmpnam]; - - return tmpnam(temp); -} - int chgtime(char *name) { --PNTmBPCT7hxwcZjr--