Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753015AbdDKTJo (ORCPT ); Tue, 11 Apr 2017 15:09:44 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:51856 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752534AbdDKTJl (ORCPT ); Tue, 11 Apr 2017 15:09:41 -0400 X-ME-Sender: Message-Id: <1491937780.536443.941636728.319DEAF0@webmail.messagingengine.com> From: Colin Walters To: Eric Blake , Greg Kurz , viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-0b509d77 References: <148830142269.7103.7429913851447595016.stgit@bahia> <99466bd0-48f2-1594-5392-5e6191d56ffa@redhat.com> <1491933162.45759.941552624.3722F8E8@webmail.messagingengine.com> <02954403-b546-0afe-39c7-23b7b05dece2@redhat.com> <9005445d-2a56-effd-55da-b3bc700c5cf2@redhat.com> Date: Tue, 11 Apr 2017 15:09:40 -0400 In-Reply-To: <9005445d-2a56-effd-55da-b3bc700c5cf2@redhat.com> Subject: Re: [PATCH 1/2] vfs: implement fchmodat2() syscall Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 955 Lines: 31 On Tue, Apr 11, 2017, at 02:07 PM, Eric Blake wrote: > > A good idea on the surface. But reading the man page of openat(), the > section on O_PATH says: > The file > itself is not opened, and other file operations (e.g., > read(2), > write(2), fchmod(2), fchown(2), fgetxattr(2), mmap(2)) > fail with > the error EBADF. Right, though more topically I'd have expected fchmodat() (not fchmod()) to take AT_EMPTY_PATH, just like fstatat() does. But it doesn't appear to be supported...oh, even at the syscall level, interesting. Ah, I see, glibc does: int fchmodat (int fd, const char *file, mode_t mode, int flag) { if (flag & ~AT_SYMLINK_NOFOLLOW) return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); ... } And indeed the syscall doesn't have flags, bringing us back to the start here. Sorry, that seems obvious in retrospect, but I was "working forwards" from the O_PATH userspace API mindset.