Date: Mon, 18 Mar 2002 14:16:39 +0200 From: Peter Pentchev <roam@ringlet.net> To: Warner Losh <imp@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/libexec/xtend user.c xtend.c Message-ID: <20020318141639.B1326@straylight.oblivion.bg> In-Reply-To: <200203180714.g2I7ExE74376@freefall.freebsd.org>; from imp@FreeBSD.org on Sun, Mar 17, 2002 at 11:14:59PM -0800 References: <200203180714.g2I7ExE74376@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--dTy3Mrz/UPE2dbVg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 17, 2002 at 11:14:59PM -0800, Warner Losh wrote: > imp 2002/03/17 23:14:59 PST >=20 > Modified files: > libexec/xtend user.c xtend.c=20 > Log: > o MAXPATHLEN is the correct constant to use for path names, it includes > the NULL. > o use snprintf in preference to unchecked strcat in a couple of places = that > likely can't overflow. Makes it easier to grep for strcpy :-) /me sprinkles some magic comma dust over the naughty-naughty imp :) [IOW, please try the attached patch :] G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence would be seven words long if it were six words shorter. Index: src/libexec/xtend/user.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/libexec/xtend/user.c,v retrieving revision 1.11 diff -u -r1.11 user.c --- src/libexec/xtend/user.c 18 Mar 2002 07:14:59 -0000 1.11 +++ src/libexec/xtend/user.c 18 Mar 2002 12:04:14 -0000 @@ -89,7 +89,7 @@ fprintf(User, "OK\n"); } } else if(!strcmp("dump\n", cmd)) { - snprintf(dumppath, sizeof(dumppath), "%s/%s" X10DIR, X10DUMPNAME); + snprintf(dumppath, sizeof(dumppath), "%s/%s", X10DIR, X10DUMPNAME); if((dumpf =3D fopen(dumppath, "w")) !=3D NULL) { for(h =3D 0; h < 16; h++) { for(i =3D 0; i < 16; i++) { Index: src/libexec/xtend/xtend.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/libexec/xtend/xtend.c,v retrieving revision 1.13 diff -u -r1.13 xtend.c --- src/libexec/xtend/xtend.c 18 Mar 2002 07:14:59 -0000 1.13 +++ src/libexec/xtend/xtend.c 18 Mar 2002 11:57:16 -0000 @@ -126,7 +126,7 @@ errx(1, "can't create directory '%s'", X10DIR); } } - snprintf(logpath, sizeof(logpath), "%s/%s" X10DIR, X10LOGNAME); + snprintf(logpath, sizeof(logpath), "%s/%s", X10DIR, X10LOGNAME); if((Log =3D fopen(logpath, "a")) =3D=3D NULL) errx(1, "can't open log file '%s'", logpath); chown(logpath, pw->pw_uid, gr->gr_gid); @@ -363,7 +363,7 @@ =20 fprintf(Log, "%s: SIGHUP received, reopening Log\n", thedate()); fclose(Log); - snprintf(logpath, sizeof(logpath), "%s/%s" X10DIR, X10LOGNAME); + snprintf(logpath, sizeof(logpath), "%s/%s", X10DIR, X10LOGNAME); if((Log =3D fopen(logpath, "a")) =3D=3D NULL) errx(1, "can't open log file '%s'", logpath); hup_flag =3D 0; --dTy3Mrz/UPE2dbVg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjyV2qcACgkQ7Ri2jRYZRVNa7ACfVFcpmr+vF+S8byl7pxhGSXi5 ZPoAoIdFgAKmXSbaiVWkZDnS26ptkRhX =XTdH -----END PGP SIGNATURE----- --dTy3Mrz/UPE2dbVg-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020318141639.B1326>