This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch master updated. glibc-2.17-493-gd755bba


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  d755bba40f880c01ced8740a26fecc85534454b9 (commit)
      from  52ce486045074d0af0298082f94e385e6b2fe443 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d755bba40f880c01ced8740a26fecc85534454b9

commit d755bba40f880c01ced8740a26fecc85534454b9
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Apr 3 10:56:45 2013 +0530

    Preserve errno across _PC_CHOWN_RESTRICTED call on XFS
    
    Fix BZ #15305.
    
    On kernel versions earlier than 2.6.29, the Linux kernel exported a
    sysctl called restrict_chown for xfs, which could be used to allow
    chown to users other than the owner.  2.6.29 removed this support,
    causing the open_not_cancel_2 to fail and thus modify errno.  The fix
    is to save and restore errno so that the caller sees it as unmodified.
    
    Additionally, since the code to check the sysctl is not useful on
    newer kernels, we add an ifdef so that in future the code block gets
    rmeoved completely.

diff --git a/ChangeLog b/ChangeLog
index 3d85c1d..64e9c88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-04-03  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	[BZ #15305]
+	* sysdeps/unix/sysv/linux/kernel-features.h
+	[__LINUX_KERNEL_VERSION >= 0x02061d]: Define
+	__ASSUME_XFS_RESTRICTED_CHOWN.
+	* sysdeps/unix/sysv/linux/pathconf.c
+	(__statfs_chown_restricted) [!__ASSUME_XFS_RESTRICTED_CHOWN]:
+	Save and restore errno.
+
 2013-04-02  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #15327]
diff --git a/NEWS b/NEWS
index 56cdc56..7718a0a 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,8 @@ Version 2.18
   10357, 11120, 11561, 12723, 13550, 13889, 13951, 14142, 14176, 14200,
   14317, 14327, 14496, 14812, 14920, 14964, 14981, 14982, 14985, 14994,
   14996, 15003, 15006, 15020, 15023, 15036, 15054, 15055, 15062, 15078,
-  15160, 15214, 15232, 15234, 15283, 15285, 15287, 15304, 15307, 15327.
+  15160, 15214, 15232, 15234, 15283, 15285, 15287, 15304, 15305, 15307,
+  15327.
 
 * Add support for calling C++11 thread_local object destructors on thread
   and program exit.  This needs compiler support for offloading C++11
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index 8fdff7e..ccd4c59 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -221,3 +221,9 @@
 #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
 # define __ASSUME_GETCPU_SYSCALL	1
 #endif
+
+/* 2.6.29 removed the XFS restricted_chown sysctl, so it is pointless looking
+   for it in newer kernels.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061d
+# define __ASSUME_XFS_RESTRICTED_CHOWN 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c
index de91a45..723d234 100644
--- a/sysdeps/unix/sysv/linux/pathconf.c
+++ b/sysdeps/unix/sysv/linux/pathconf.c
@@ -289,11 +289,16 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf)
       return -1;
     }
 
+#if __ASSUME_XFS_RESTRICTED_CHOWN
+  return 1;
+#else
   int fd;
+  int save_errno;
   long int retval = 1;
   switch (fsbuf->f_type)
     {
     case XFS_SUPER_MAGIC:
+      save_errno = errno;
       /* 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);
@@ -306,6 +311,7 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf)
 
 	  close_not_cancel_no_status (fd);
 	}
+      __set_errno (save_errno);
       break;
 
     default:
@@ -313,4 +319,5 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf)
     }
 
   return retval;
+#endif
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                 |   10 ++++++++++
 NEWS                                      |    3 ++-
 sysdeps/unix/sysv/linux/kernel-features.h |    6 ++++++
 sysdeps/unix/sysv/linux/pathconf.c        |    7 +++++++
 4 files changed, 25 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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