From owner-freebsd-fs@FreeBSD.ORG Tue Apr 5 19:41:42 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07410106566C; Tue, 5 Apr 2011 19:41:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 8008D8FC1F; Tue, 5 Apr 2011 19:41:40 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p35JfbL5025183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Apr 2011 05:41:38 +1000 Date: Wed, 6 Apr 2011 05:41:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20110405185751.GE78089@deviant.kiev.zoral.com.ua> Message-ID: <20110406053603.F3067@besplex.bde.org> References: <20110405141631.GA78089@deviant.kiev.zoral.com.ua> <20110405154002.GD78089@deviant.kiev.zoral.com.ua> <20110405183104.2304d94e@ernst.jennejohn.org> <201104051316.32704.jhb@freebsd.org> <20110405185751.GE78089@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org Subject: Re: Knob to turn off _POSIX_NO_TRUNC X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 19:41:42 -0000 On Tue, 5 Apr 2011, Kostik Belousov wrote: > On Tue, Apr 05, 2011 at 01:16:32PM -0400, John Baldwin wrote: >> Personally, I find this a bit hackish. You could always "fix" the 3rd >> party software by using LD_PRELOAD() to implement a wrapper around >> open() that trimmed the name if open() fails with ENAMETOOLONG. Or install it on one of the file systems that has {_PC_NO_TRUNC} = 0 (might need a chroot, and the following fix). > Ok, I am taking the patch aside then. Please note that the change > as is allowed any vfs syscall taking the path, to proceed. Also, > the arbitrary path element, not only the last one, was handled. > But this is only a question of amount of code in the preloaded > library. There is one thing that can be changed without incrementing the bug count: make {_PC_NO_TRUNC} = 0 actually work. Currently, this fails for pathnames larger than NAME_MAX, since vfs doesn't know what either {NAME_MAX} or {_PC_NO_TRUNC} are and always assumes the global values. Bruce