From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7578 invoked by alias); 13 Sep 2012 16:42:30 -0000 Received: (qmail 7518 invoked by uid 22791); 13 Sep 2012 16:42:29 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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 16:42:10 +0000 From: "mgorny at gentoo dot org" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/14578] New: fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks Date: Thu, 13 Sep 2012 16:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mgorny at gentoo dot org 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: 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/msg00103.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14578 Bug #: 14578 Summary: fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: unassigned@sourceware.org ReportedBy: mgorny@gentoo.org CC: drepper.fsp@gmail.com Classification: Unclassified Tested with glibc-2.15, the relevant code verified to be the same in current git. CHOST: x86_64-unknown-linux-gnu Kernel: 3.5.0 (vanilla) Whenever fchmodat() is called with AT_SYMLINK_NOFOLLOW on Linux, it unconditionally fails with ENOTSUP. The following snippet from sysdeps/unix/sysv/linux/fchmodat.c is responsible for that: #ifndef __NR_lchmod /* Linux so far has no lchmod syscall. */ if (flag & AT_SYMLINK_NOFOLLOW) { __set_errno (ENOTSUP); return -1; } #endif POSIX.2008 however specifies[1] that: [EOPNOTSUPP] The AT_SYMLINK_NOFOLLOW bit is set in the flag argument, path names a symbolic link, and the system does not support changing ^^^^^^^^^^^^^^^^^^^^^^^^^^ the mode of a symbolic link. In other words, I believe that fchmodat() should only return ENOTSUP if AT_SYMLINK_NOFOLLOW is requested on a symbolic link. On regular files, it should just change the mode. [1]:http://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html -- 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.