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/15822] New: Clashing specifications _POSIX_CHOWN_RESTRICTED (and possibly others)


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

            Bug ID: 15822
           Summary: Clashing specifications _POSIX_CHOWN_RESTRICTED (and
                    possibly others)
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: james_avera2 at yahoo dot com
                CC: drepper.fsp at gmail dot com

(I first noticed this in glibc 2.17 in Ubuntu 13.04, but the problem is still
there in the latest source checked out from git on 8/7/13)

The semantics of _POSIX_CHOWN_RESTRICTED and possibly other feature-defines
are specified in two conflicting ways.  A programmer reading one of these specs
will write wrong code if they don't notice.

unistd.h says:

"If any of these symbols is defined as -1, the corresponding option is not
true for any file.  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'. 

  _POSIX_CHOWN_RESTRICTED
  _POSIX_NO_TRUNC 
  etc.
"

However, bits/posix_opt.h contains this:

/* Some filesystems allow all users to change file ownership.  */
#define _POSIX_CHOWN_RESTRICTED 0

The comment with this definition implies that chown is not always restricted.
But in that case, according to unistd.h, the symbol should not be defined at
all
(unistd.h says that if defined with *any* value other than -1, then the feature
is true in all cases; there is no mention of a value of 0 being meaningful.)

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