From owner-freebsd-audit Sun Apr 29 2: 1: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from obsecurity.dyndns.org (adsl-63-207-60-27.dsl.lsan03.pacbell.net [63.207.60.27]) by hub.freebsd.org (Postfix) with ESMTP id DD28937B422 for ; Sun, 29 Apr 2001 02:00:58 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 885F366C9B; Sun, 29 Apr 2001 02:00:58 -0700 (PDT) Date: Sun, 29 Apr 2001 02:00:58 -0700 From: Kris Kennaway To: audit@FreeBSD.org Subject: m4 mkstemp() fixes Message-ID: <20010429020057.A76909@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This one is obtained from OpenBSD. Even though it contains the style bug of scoped variable definitions, since this patch reduces diffs to OpenBSD I think it should stay that way. Kris Index: eval.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /mnt/ncvs/src/usr.bin/m4/eval.c,v retrieving revision 1.11 diff -u -r1.11 eval.c --- eval.c 2000/11/27 04:26:39 1.11 +++ eval.c 2001/04/29 08:58:55 @@ -295,8 +295,19 @@ /* * dotemp - create a temporary file */ - if (argc > 2) - pbstr(mktemp(argv[2])); + if (argc > 2) { + int fd; + char *temp; + + temp =3D xstrdup(argv[2]); + =09 + fd =3D mkstemp(temp); + if (fd =3D=3D -1) + err(1, "couldn't make temp file %s", argv[2]); + close(fd); + pbstr(temp); + free(temp); + } break; =20 case TRNLTYPE: --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE669hJWry0BWjoQKURAvRTAKDQWDeK3CadWzhP+mqlQauhMTqSggCgmJ2z uOASVp/SQsAY0gDZHtUz/q8= =dT1L -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message