From owner-svn-src-head@freebsd.org Sun Nov 15 19:06:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32152464E64; Sun, 15 Nov 2020 19:06:25 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CZ1rx0B94z3Hbd; Sun, 15 Nov 2020 19:06:24 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 7969ACAF; Sun, 15 Nov 2020 14:06:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 15 Nov 2020 14:06:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=5 VAFw7FqORNuQgPhtFHTtygZfwRHF+/0mGfWnQiUFjA=; b=wPhtz8uK/TKQ65bui +mjjxEv9ft+pwOLUCIRl+C0F4wRBo2NYRDJhtSX2hjfhGxf7deycCQUigcYm/9pT TmMWlEPe9qYA6obt4nFirFKKRCq100A2XO79VzA6h1o5FrfrLzbXkzPRx7eccNzc sXgKLayVYSmz0kW7ApS9ZmFftN4T4AO49ey6o1kLdNMHkm13PJGm3EBpVqKsFIfI gQPeRdFv5AK5PFGd7RSqh9gbnzHblvM/pTFv2+V9B76ejrMvL2WCXbJcasxpLWBj emO7U6xSh/gwZBjt9Qu/mckP5EhxmDxK9Zmf5erUOY7CpoU6xm7t+aF5uNq/1PwG 58rIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=5VAFw7FqORNuQgPhtFHTtygZfwRHF+/0mGfWnQiUF jA=; b=Qca6O3bgGRd1d2xIOPl3igm+8GJdhgeb4nyrLqH4jA+y/PJKg1hS2I8hv Fquq6D6BsEJPSOZ/9oYfg9U4ZxFekwRwIt+aRRiFsuYHdTj50IXK8wUqHYvm8tUQ 5I/AfRCh2qsjktEJqjiTgdV53mKnYsYQvKxxMDB5OnHdMaurDsUY+s7ID4IOLsb+ gq1LwqH4M8AUZqb4e/nptOaphXUeV3Jk5vgKplGE1AFZRv6XwNbXqeTJs9pR5JiI 7iIh7rr9YY/SA2ddZZH9oMftlo4ZltfeItliEQ9UxJt8Aaq/FrZeTc5aFLdvIbNX Nab2YaL5UsbhzHx33tOHbH6rUK95Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvledguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuufhorhhtvgguuchrvggtihhpshculdegtddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomhepufgtohht thcunfhonhhguceoshgtohhtthhlsehsrghmshgtohdrohhrgheqnecuggftrfgrthhtvg hrnhepudduveekheehiedukeekleelvedufeevfeetudfgtdffteffleehheffueffgfeh necuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppeekrdegiedrkeelrddvud efnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgt ohhtthhlsehsrghmshgtohdrohhrgh X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id A41C63064AA7; Sun, 15 Nov 2020 14:06:22 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: svn commit: r367701 - head/lib/libutil From: Scott Long In-Reply-To: <329C4753-BB97-4C67-8CDA-39EB67E16CE8@freebsd.org> Date: Sun, 15 Nov 2020 12:06:22 -0700 Cc: Scott Long , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <202011150748.0AF7mqW3016900@repo.freebsd.org> <329C4753-BB97-4C67-8CDA-39EB67E16CE8@freebsd.org> To: Jessica Clarke X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4CZ1rx0B94z3Hbd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2020 19:06:25 -0000 > On Nov 15, 2020, at 12:01 PM, Jessica Clarke = wrote: >>=20 >> I felt similar concerns, but my misunderstanding of strlcpy() drove = the >> result. Since the use case for getlocalbase() lends itself to also = use >> strlcat()/strlcpy(), I was trying to replicate the API semantics of = those, >> at least to the limit of my understanding. Thanks for the feedback, = I=E2=80=99ll >> look at it some more. >=20 > Thanks. ENOMEM also feels inappropriate as no allocation is taking > place. Perhaps ENAMETOOLONG, which is used in similar cases for things > like gethostbyname? Though sysctlbyname uses ENOMEM instead... sigh. >=20 Yep, I wasn=E2=80=99t happy with ENOMEM either but I couldn=E2=80=99t = find anything better. > Also, if pathlen has already been checked against SSIZE_MAX (giving > EINVAL) and tmplen against pathlen there's no need to then check = tmplen > against SSIZE_MAX. >=20 Done. > I'd be happy to give a review on Phabricator if/when you have a new > patch. >=20 https://reviews.freebsd.org/D27227 Thanks, Scott