From owner-freebsd-audit Fri Mar 9 14:27: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 04CAC37B71B; Fri, 9 Mar 2001 14:27:03 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.1/8.11.1) with ESMTP id f29MQqI11070; Fri, 9 Mar 2001 15:26:52 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200103092226.f29MQqI11070@harmony.village.org> To: Brian Somers Subject: Re: libutil/MAXHOSTNAMELEN changes - plus a buffer overrun fix Cc: freebsd-audit@FreeBSD.ORG, eivind@FreeBSD.ORG In-reply-to: Your message of "Fri, 09 Mar 2001 22:24:35 GMT." <200103092224.f29MOZu05704@hak.lan.Awfulhak.org> References: <200103092224.f29MOZu05704@hak.lan.Awfulhak.org> Date: Fri, 09 Mar 2001 15:26:52 -0700 From: Warner Losh Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200103092224.f29MOZu05704@hak.lan.Awfulhak.org> Brian Somers writes: : [.....] } : > : > : + strncpy(host, buf, hsize); : > : > : > : > Should likely use strlcpy. : > : : > : The returned string (host) is not meant to be terminated if the host : > : fits exactly - eg, realhostname(ut.ut_host, UT_HOSTSIZE, ...). : > : > Then we should terminate it. That's a lame interface. : : It's a practical interface. It's also a public interface :*) Ummm, it is lame in that it doesn't NUL termniate. Is it a standard, or can we change it. If we lose one character for utmp, I don't care. Intefaces like this are inharently lame and should not be encouraged and actively discouraged when possible. That's what I'm doing right now. Actively discouraging it and trying to get it changed. Warmer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message