Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Apr 2001 02:00:58 -0700
From:      Kris Kennaway <kris@obsecurity.org>
To:        audit@FreeBSD.org
Subject:   m4 mkstemp() fixes
Message-ID:  <20010429020057.A76909@xor.obsecurity.org>

next in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010429020057.A76909>