From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: *at syscalls for xattrs? Date: Mon, 16 Jul 2007 05:47:46 -0400 Message-ID: <469B3EC2.8080702@garzik.org> References: <20070715205313.GE21668@ftp.linux.org.uk> <1184534001.2765.5.camel@entropy> <20070715222323.GG21668@ftp.linux.org.uk> <469B2CAE.9010101@goop.org> <469B3B73.9010400@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Miklos Szeredi , jeremy@goop.org, jengelh@computergmbh.de, viro@ftp.linux.org.uk, nmiell@comcast.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: "H. Peter Anvin" Return-path: Received: from srv5.dvmed.net ([207.36.208.214]:58004 "EHLO mail.dvmed.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762892AbXGPJsq (ORCPT ); Mon, 16 Jul 2007 05:48:46 -0400 In-Reply-To: <469B3B73.9010400@zytor.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org H. Peter Anvin wrote: > Miklos Szeredi wrote: >> The *at() thing basically gives you the advantages of a CWD without >> the disadvantages. >> >> For example it could be useful to implement the functionality of >> find(1) as a library interface. >> > > What the *at() interfaces really do is fix/paper over a longstanding > wart in Unix: the cwd really should have been a standard file descriptor > (like stdin/stdout/stderr) instead of a magic piece of state maintained > in kernel space. It's more than a wart, IMO. *at() allows one to close races (with potential security implications) that are otherwise impossible to close, in directory traversal. *at() permits a userspace program to hold proper references to all objects during a directory traversal, with all that implies. Jeff