From owner-freebsd-audit Wed Mar 28 5:27:47 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peitho.fxp.org (peitho.fxp.org [209.26.95.40]) by hub.freebsd.org (Postfix) with ESMTP id AA83937B71E for ; Wed, 28 Mar 2001 05:27:43 -0800 (PST) (envelope-from jedgar@www.fxp.org) Received: from sushi.44bsd.net (oca-pm3-1-28.hitter.net [207.192.76.28]) by peitho.fxp.org (Postfix) with ESMTP id 914521360C; Wed, 28 Mar 2001 08:27:41 -0500 (EST) Received: by sushi.44bsd.net (Postfix, from userid 1000) id E84D3BA83; Wed, 28 Mar 2001 08:27:38 -0500 (EST) Date: Wed, 28 Mar 2001 08:27:38 -0500 From: Chris Faulhaber To: Eric Melville Cc: freebsd-audit@freebsd.org Subject: Re: [murray@osd.bsdi.com: Re: quick patch to window(1)] Message-ID: <20010328082738.A3405@sushi.44bsd.net> Mail-Followup-To: Chris Faulhaber , Eric Melville , freebsd-audit@freebsd.org References: <20010327092052.A56508@meow.osd.bsdi.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010327092052.A56508@meow.osd.bsdi.com>; from eric@meow.osd.bsdi.com on Tue, Mar 27, 2001 at 09:20:52AM -0800 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 27, 2001 at 09:20:52AM -0800, Eric Melville wrote: > % This is really simple and brain-dead, and it's mostly just to keep from > % using mktemp(3) (which is deprecated, etc). > % > % Index: scanner.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: /home/ncvs/src/usr.bin/window/scanner.c,v > % retrieving revision 1.3 > % diff -r1.3 scanner.c > % 290c290 > % < && (cx.x_val.v_str =3D str_cpy(buf)) =3D=3D 0) { > % --- > % > && (cx.x_val.v_str =3D (void *)str_cpy(buf)) =3D=3D 0) { Why the cast? v_str (aka v_un.V_str) is char*, the same that str_cpy() returns... Of course, it would probably be better if the hand-rolled str_cpy() and str_ncpy() went away and replaced with strdup()/strlcpy() and some error checking (of which window(1) seems to do very little). > % Index: wwterminfo.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: /home/ncvs/src/usr.bin/window/wwterminfo.c,v > % retrieving revision 1.4 > % diff -r1.4 wwterminfo.c > % 67,68c67 > % < mktemp(wwterminfopath); > % < if (mkdir(wwterminfopath, 0755) < 0 || > % --- > % > if (mkdtemp(wwterminfopath) < 0 || > % Looks good. --=20 Chris D. Faulhaber - jedgar@fxp.org - jedgar@FreeBSD.org -------------------------------------------------------- FreeBSD: The Power To Serve - http://www.FreeBSD.org --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: FreeBSD: The Power To Serve iEYEARECAAYFAjrB5soACgkQObaG4P6BelACHQCdEaxtM4CmDFmNthyh3x8TXuWU xXkAnj6bfq2ZkqjUkxZjECiTOYCI3v1M =p+gx -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message