From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfng-0006Bq-6V for qemu-devel@nongnu.org; Tue, 04 Feb 2014 08:12:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAfnX-0001Lc-55 for qemu-devel@nongnu.org; Tue, 04 Feb 2014 08:12:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAfnW-0001LG-T8 for qemu-devel@nongnu.org; Tue, 04 Feb 2014 08:12:19 -0500 Message-ID: <52F0E72A.7050200@redhat.com> Date: Tue, 04 Feb 2014 06:12:10 -0700 From: Eric Blake MIME-Version: 1.0 References: <52EF68CA.9060604@gmail.com> <20140203103429.GB10408@redhat.com> <52EF71DC.3000309@gmail.com> <52F0C8BA.7020709@gmail.com> <87vbwvoyij.fsf@blackfin.pond.sub.org> In-Reply-To: <87vbwvoyij.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4FEVJsBoWqXsXHGKxtoE0HWgO9eFwlx8C" Subject: Re: [Qemu-devel] [PATCH] hw/9pfs/virtio-9p-local.c: use snprintf() instead of sprintf() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Chen Gang Cc: aneesh.kumar@linux.vnet.ibm.com, aliguori@amazon.com, QEMU Developers This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4FEVJsBoWqXsXHGKxtoE0HWgO9eFwlx8C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/04/2014 05:25 AM, Markus Armbruster wrote: > Second guessing when a pathname is too long for a system call is not a > good idea. If it's too long, the system call will tell you. As Dan > noted, PATH_MAX is *not* a hard limit. >=20 > {PATH_MAX} > Maximum number of bytes the implementation will store as a > pathname in a user-supplied buffer of unspecified size, > including the terminating null character. Minimum number the > implementation will accept as the maximum number of bytes in a > pathname. Linux allows unbelievably long absolute names. Jim Meyering proved with coreutils that you can create an absolute name well over a megabyte in length. The trick is that you have to access it via relative names where each relative name is PATH_MAX or less (that is, the Linux kernel refuses to operate on more than a page at a time when doing file name resolution), by using openat() and friends. mkdirat() can create a directory with an absolute name longer than PATH_MAX, even if mkdir() can= 't. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4FEVJsBoWqXsXHGKxtoE0HWgO9eFwlx8C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS8OcqAAoJEKeha0olJ0Nq95sH/0KjY/NmO7/nIsiB0ZZEdAI5 CyQOGHh6MLHXq5fDUjp4YkHfq5H7Xa3ikXnfGacVN9dkoMp3weUeJr0BIkOtu/HV tAT3mb45n9oh74osSdubIqxp1WOirXNzTZWj2O78kki4FxP0Kv7puUEdbAtsGwCr xdACv/OOp8QbGj4M16civ1JKMAcF7rOLvNc2BST28Yw0Q3l3A+BWtITtyB7pkZJ2 BWHL/anl1dC+wnu10IS5xstfr34oHJ0QMP8n9G7ibN4NW7NdkeHm9+JA9lG+gguZ sxR3wN5DwItpi+PDpbX3YNtjWz3GjjEfZbNLyW6ULREh003hMzYvepIqCGBEgIg= =JrCu -----END PGP SIGNATURE----- --4FEVJsBoWqXsXHGKxtoE0HWgO9eFwlx8C--