From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28317 invoked by alias); 13 Sep 2012 17:01:45 -0000 Received: (qmail 28293 invoked by uid 22791); 13 Sep 2012 17:01:38 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Sep 2012 17:01:25 +0000 From: "joseph at codesourcery dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/14578] fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks Date: Thu, 13 Sep 2012 17:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00104.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14578 --- Comment #1 from joseph at codesourcery dot com 2012-09-13 17:01:22 UTC --- glibc can't check if it's a symlink itself without a race condition. What does the kernel do if AT_SYMLINK_NOFOLLOW is passed to the fchmodat syscall (both on symlinks, and on non-symlinks? (Any code expecting an lchmod syscall can clearly be removed from glibc in any case - chmod support for symlinks in future would have to be via a *at syscall to accord with current Linux kernel practice regarding adding syscalls - so #ifndef __NR_lchmod should be unconditional, #ifdef __NR_lchmod removed.) If the syscall does the right thing, I suppose the check for AT_SYMLINK_NOFOLLOW could be moved after the code using the fchmodat syscall, so that the issue only applies to old kernels (for which it is unavoidable because of the race). -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.