public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/15305] New: POSIX problem: pathconf/fpathconf modifies errno for XFS filesystems on Linux
@ 2013-03-26 18:03 licquia at linuxfoundation dot org
  2013-03-28 15:02 ` [Bug libc/15305] " carlos at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: licquia at linuxfoundation dot org @ 2013-03-26 18:03 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=15305

             Bug #: 15305
           Summary: POSIX problem: pathconf/fpathconf modifies errno for
                    XFS filesystems on Linux
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: licquia@linuxfoundation.org
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


Created attachment 6950
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6950
test program to demonstrate the problem

When pointed at a file on a XFS filesystem under Linux, pathconf(path,
_PC_CHOWN_RESTRICTED) attempts to open /proc/sys/fs/xfs/restrict_chown to
determine what it should do.  This open fails (because the path is not
supported on recent kernels), which modifies errno.

>From http://pubs.opengroup.org/onlinepubs/009695399/functions/pathconf.html:

"Otherwise, pathconf() or fpathconf() shall return the current variable value
for the file or directory without changing errno."

(describing non-error situations)

I've attached a test program, which takes a path to test as its argument. 
Here's the behavior I see on Fedora 18, with ext4 as the regular filesystem and
an XFS loopback filesystem on ./mountpoint:

[licquia@lflap5 lsb-bug-3763]$ ./test-pathconf-errno /etc
pathconf returned 1
errno not changed
[licquia@lflap5 lsb-bug-3763]$ ./test-pathconf-errno ./mountpoint
pathconf returned 1
errno changed!
 pre = 0
 post = 2

The behavior is identical with git HEAD using LD_PRELOAD.

-- 
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-13 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 18:03 [Bug libc/15305] New: POSIX problem: pathconf/fpathconf modifies errno for XFS filesystems on Linux licquia at linuxfoundation dot org
2013-03-28 15:02 ` [Bug libc/15305] " carlos at redhat dot com
2013-04-01 11:35 ` siddhesh at redhat dot com
2013-04-03  6:49 ` siddhesh at redhat dot com
2014-06-13 18:38 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).