]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[BZ #5778]
authorUlrich Drepper <drepper@redhat.com>
Sat, 8 Mar 2008 01:57:18 +0000 (01:57 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 8 Mar 2008 01:57:18 +0000 (01:57 +0000)
* sysdeps/unix/sysv/linux/pathconf.h: Declare
__statfs_chown_restricted.
* sysdeps/unix/sysv/linux/fpathconf.c: Call __statfs_chown_restricted
for _PC_CHOWN_RESTRICTED.
* sysdeps/unix/sysv/linux/pathconf.c: Likewise.
Implement __statfs_chown_restricted.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
_POSIX_CHOWN_RESTRICTED value to zero.

2008-02-26  Harsha Jagasia  <harsha.jagasia@amd.com>

ChangeLog
localedata/ChangeLog
localedata/locales/es_CR
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
sysdeps/unix/sysv/linux/bits/posix_opt.h
sysdeps/unix/sysv/linux/fpathconf.c
sysdeps/unix/sysv/linux/pathconf.c
sysdeps/unix/sysv/linux/pathconf.h

index 0a4204719852fd0a449c05eab5d18a0b4b23057b..9d9cf3b54fadf1176af1dfc3a2b3a3d3911dbde9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,18 @@
 2008-03-07  Ulrich Drepper  <drepper@redhat.com>
 
+       [BZ #5778]
+       * sysdeps/unix/sysv/linux/pathconf.h: Declare
+       __statfs_chown_restricted.
+       * sysdeps/unix/sysv/linux/fpathconf.c: Call __statfs_chown_restricted
+       for _PC_CHOWN_RESTRICTED.
+       * sysdeps/unix/sysv/linux/pathconf.c: Likewise.
+       Implement __statfs_chown_restricted.
+       * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
+       _POSIX_CHOWN_RESTRICTED value to zero.
+
        * sysdeps/x86_64/rtld-memset.c: New file.
 
-2008-2-26  Harsha Jagasia  <harsha.jagasia@amd.com>
+2008-02-26  Harsha Jagasia  <harsha.jagasia@amd.com>
 
        * sysdeps/x86_64/cacheinfo.c (NOT_USED_RIGHT_NOW): Remove ifdef guards.
 
index 8da017d52bca652172191155065845295f5a4c04..e435623715d120b87cd51f8911a1b54a741d118d 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-07  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #5777]
+       * locales/es_CR: Define am/pm format.
+
 2008-03-04  Ulrich Drepper  <drepper@redhat.com>
 
        * SUPPORTED (SUPPORTED-LOCALES): Add shs_CA.UTF-8.
index aa335a2fe9ca9424eb1fb411b424d591d044d56c..753b22b0555855524a4d04be93b5b4f44340857b 100644 (file)
@@ -108,8 +108,8 @@ mon     "<U0065><U006E><U0065><U0072><U006F>";/
 d_t_fmt "<U0025><U0061><U0020><U0025><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U0020><U0025><U0054><U0020><U0025><U005A>"
 d_fmt   "<U0025><U0064><U002F><U0025><U006D><U002F><U0025><U0079>"
 t_fmt   "<U0025><U0054>"
-am_pm   "";""
-t_fmt_ampm ""
+am_pm   "<U0061><U002E><U006D><U002E>";"<U0070><U002E><U006D><U002E>"
+t_fmt_ampm "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
 date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
index e22f3870a9d85a1219489ef08a412d828a442288..c2a13543fba622a0ee54df1fe86457301707189f 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-07  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #5778]
+       * sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
+       _POSIX_CHOWN_RESTRICTED value to zero.
+
 2008-01-31  Roland McGrath  <roland@redhat.com>
 
        * Makefile (omit-deps): Variable removed.
index dd0798a0737fc9c8044f36ee959bce31edec5cee..06d35ceb16036968001975eb124ed6f6f6a02b20 100644 (file)
@@ -1,5 +1,5 @@
 /* Define POSIX options for Linux.
-   Copyright (C) 1996-2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2006, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,8 +47,8 @@
 /* Setting of memory protections is supported.  */
 #define        _POSIX_MEMORY_PROTECTION        200112L
 
-/* Only root can change owner of file.  */
-#define        _POSIX_CHOWN_RESTRICTED 1
+/* Some filesystems allow all users to change file ownership.  */
+#define        _POSIX_CHOWN_RESTRICTED 0
 
 /* `c_cc' member of 'struct termios' structure can be disabled by
    using the value _POSIX_VDISABLE.  */
index 1a96db298226ca6143f29c30755614a7dc7d30e1..37612e0bd56932c68f19695c41ce992d5076c305 100644 (file)
@@ -1,5 +1,6 @@
 /* Define POSIX options for Linux.
-   Copyright (C) 1996,1997,1999,2000,2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1999,2000,2002,2003,2008
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -51,8 +52,8 @@
 /* Setting of memory protections is supported.  */
 #define        _POSIX_MEMORY_PROTECTION        200112L
 
-/* Only root can change owner of file.  */
-#define        _POSIX_CHOWN_RESTRICTED 1
+/* Some filesystems allow all users to change file ownership.  */
+#define        _POSIX_CHOWN_RESTRICTED 0
 
 /* `c_cc' member of 'struct termios' structure can be disabled by
    using the value _POSIX_VDISABLE.  */
index c1cdb1b8996e0bea0e30714b20bcbf58762d6335..2701c9ec99bcb4be93cd9f329af6a000d061e632 100644 (file)
@@ -1,5 +1,5 @@
 /* Get file-specific information about descriptor FD.  Linux version.
-   Copyright (C) 1991,1995,1996,1998-2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995,1996,1998-2003,2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -45,6 +45,9 @@ __fpathconf (fd, name)
     case _PC_2_SYMLINKS:
       return __statfs_symlinks (__fstatfs (fd, &fsbuf), &fsbuf);
 
+    case _PC_CHOWN_RESTRICTED:
+      return __statfs_chown_restricted (__fstatfs (fd, &fsbuf), &fsbuf);
+
     default:
       return posix_fpathconf (fd, name);
     }
index e12a08434a104d46be8ef10dd788cd8201f49174..db03529fe87f7b6f03cc1147af7024ceb8bbb7e1 100644 (file)
@@ -1,5 +1,5 @@
 /* Get file-specific information about a file.  Linux version.
-   Copyright (C) 1991,1995,1996,1998-2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995,1996,1998-2003,2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 
 #include <unistd.h>
 #include <errno.h>
+
 #include "pathconf.h"
 #include "linux_fsinfo.h"
+#include <not-cancel.h>
 
 static long int posix_pathconf (const char *file, int name);
 
@@ -46,6 +48,9 @@ __pathconf (const char *file, int name)
     case _PC_2_SYMLINKS:
       return __statfs_symlinks (__statfs (file, &fsbuf), &fsbuf);
 
+    case _PC_CHOWN_RESTRICTED:
+      return __statfs_chown_restricted (__statfs (file, &fsbuf), &fsbuf);
+
     default:
       return posix_pathconf (file, name);
     }
@@ -179,3 +184,44 @@ __statfs_symlinks (int result, const struct statfs *fsbuf)
       return 1;
     }
 }
+
+
+/* Used like: return __statfs_chown_restricted (__statfs (name, &buf), &buf);*/
+long int
+__statfs_chown_restricted (int result, const struct statfs *fsbuf)
+{
+  if (result < 0)
+    {
+      if (errno == ENOSYS)
+       /* Not possible, return the default value.  */
+       return 1;
+
+      /* Some error occured.  */
+      return -1;
+    }
+
+  int fd;
+  long int retval = 1;
+  switch (fsbuf->f_type)
+    {
+    case XFS_SUPER_MAGIC:
+      /* Read the value from /proc/sys/fs/xfs/restrict_chown.  If we cannot
+        read it default to assume the restriction is in place.  */
+      fd = open_not_cancel_2 ("/proc/sys/fs/xfs/restrict_chown", O_RDONLY);
+      if (fd != -1)
+       {
+         char buf[2];
+         if (TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, 2)) == 2
+             && buf[0] >= '0' && buf[0] <= '1')
+           retval = buf[0] - '0';
+
+         close_not_cancel_no_status (fd);
+       }
+      break;
+
+    default:
+      break;
+    }
+
+  return retval;
+}
index 20e23685ebf775930bca6f66454ddb40732d83d4..806adcc5ea97067e047bcf4d9dc07e9869c57633 100644 (file)
@@ -1,5 +1,5 @@
 /* Common parts of Linux implementation of pathconf and fpathconf.
-   Copyright (C) 1991,1995,1996,1998-2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1991,1995,1996,1998-2003,2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #include <sys/statfs.h>
 
 
-/* Used like: return statfs_link_max (__statfs (name, &buf), &buf); */
+/* Used like: return __statfs_link_max (__statfs (name, &buf), &buf); */
 extern long int __statfs_link_max (int result, const struct statfs *fsbuf);
 
 
-/* Used like: return statfs_filesize_max (__statfs (name, &buf), &buf); */
+/* Used like: return __statfs_filesize_max (__statfs (name, &buf), &buf); */
 extern long int __statfs_filesize_max (int result, const struct statfs *fsbuf);
 
 
-/* Used like: return statfs_link_max (__statfs (name, &buf), &buf); */
+/* Used like: return __statfs_link_max (__statfs (name, &buf), &buf); */
 extern long int __statfs_symlinks (int result, const struct statfs *fsbuf);
+
+
+/* Used like: return __statfs_chown_restricted (__statfs (name, &buf), &buf);*/
+extern long int __statfs_chown_restricted (int result,
+                                          const struct statfs *fsbuf);