public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/5778] New: pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux
@ 2008-02-20 14:05 axel dot philipp at mtu dot de
  2008-03-08  1:59 ` [Bug libc/5778] " drepper at redhat dot com
  2008-03-10 16:18 ` axel dot philipp at mtu dot de
  0 siblings, 2 replies; 4+ messages in thread
From: axel dot philipp at mtu dot de @ 2008-02-20 14:05 UTC (permalink / raw)
  To: glibc-bugs

pathconf(path,_PC_CHOWN_RESTRICTED)always returns POSIX_CHOWN_RESTRICTED even 
if the filesystem where path is located is configured to allow unrestricted 
chown. 

This seems to be an inconsistency between kernel, glibc and LSB. although the 
Linux syscall chown allows unpriviliged users to chown files if the filesystem 
does, LSB 3.2 core generic para. 13.4.79 mandates that POSIX_CHOWN_RESTRICTED 
be defined as 1. This variable should be undefined because that feature 
definitely depends on filesystem and need not be the same for all fs on a host.

But even if POSIX_CHOWN_RESTRICTED were undefined, pathconf would return the 
wrong value since it always returns -1 in that case.

I checked today http://sources.redhat.com/cgi-
bin/cvsweb.cgi/libc/sysdeps/posix/?cvsroot=glibc, pathconf.c is the same since 
2003, I tested with 2.3.5.

Filesystems with unrestricted chown can be local (XFS 
with /proc/sys/fs/xfs/restrict_chown=0) or NFS mounted.

-- 
           Summary: pathconf(path,_PC_CHOWN_RESTRICTED) does not work
                    correctly under Linux
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: axel dot philipp at mtu dot de
                CC: glibc-bugs at sources dot redhat dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/5778] pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux
  2008-02-20 14:05 [Bug libc/5778] New: pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux axel dot philipp at mtu dot de
@ 2008-03-08  1:59 ` drepper at redhat dot com
  2008-03-10 16:18 ` axel dot philipp at mtu dot de
  1 sibling, 0 replies; 4+ messages in thread
From: drepper at redhat dot com @ 2008-03-08  1:59 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2008-03-08 01:58 -------
When the pathconf code was written xfs didn't exist for Linux.  I've changed it.
 What LSB is of no relevance, it has nothing whatsoever to do with glibc.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/5778] pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux
  2008-02-20 14:05 [Bug libc/5778] New: pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux axel dot philipp at mtu dot de
  2008-03-08  1:59 ` [Bug libc/5778] " drepper at redhat dot com
@ 2008-03-10 16:18 ` axel dot philipp at mtu dot de
  1 sibling, 0 replies; 4+ messages in thread
From: axel dot philipp at mtu dot de @ 2008-03-10 16:18 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From axel dot philipp at mtu dot de  2008-03-10 16:17 -------
Thanks for the patch.
When I look at the explanation in posix/unistd.h
   If any is defined as other than -1, the corresponding
   option is true for all files.  If a symbol is not defined at all, the value
   for a specific file can be obtained from `pathconf' and `fpathconf'.
I wonder whether _POSIX_CHOWN_RESTRICTED shouldn't be undefined instead of 
being set to 0.

XFS was just an example. Linux also allows unrestricted chown on NFS mounted 
filesystems if the NFS server is configured so. It's certainly difficult for 
glibc to handle such cases as long as the kernel does not provide a query 
interface for pathconf. Perhaps errno could be set to EINVAL (in the meaning of 
not implemented) in such cases.

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/5778] pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux
       [not found] <bug-5778-131@http.sourceware.org/bugzilla/>
@ 2014-07-02  7:22 ` fweimer at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-07-02  7:22 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=5778

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-07-02  7:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-20 14:05 [Bug libc/5778] New: pathconf(path,_PC_CHOWN_RESTRICTED) does not work correctly under Linux axel dot philipp at mtu dot de
2008-03-08  1:59 ` [Bug libc/5778] " drepper at redhat dot com
2008-03-10 16:18 ` axel dot philipp at mtu dot de
     [not found] <bug-5778-131@http.sourceware.org/bugzilla/>
2014-07-02  7:22 ` 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).