This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15305] New: POSIX problem: pathconf/fpathconf modifies errno for XFS filesystems on Linux


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]