[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r12558 - in /fsf/trunk/libc: ./ nptl/ nptl/sysdeps/pthread/ posix/ sysdeps/unix/sysv/linux/ sysdeps/unix/sysv/linux/i386/



Author: eglibc
Date: Sat Jan 15 00:03:01 2011
New Revision: 12558

Log:
Import glibc-mainline for 2011-01-15

Added:
    fsf/trunk/libc/sysdeps/unix/sysv/linux/setgroups.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/pthread/setxid.h
    fsf/trunk/libc/posix/fnmatch_loop.c
    fsf/trunk/libc/posix/globtest.sh
    fsf/trunk/libc/posix/testfnm.c
    fsf/trunk/libc/posix/tst-fnmatch.input
    fsf/trunk/libc/posix/tst-fnmatch2.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/setgroups.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Jan 15 00:03:01 2011
@@ -1,3 +1,19 @@
+2011-01-14  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #10563]
+	* sysdeps/unix/sysv/linux/i386/setgroups.c: Use INLINE_SETXID_SYSCALL
+	to make the syscall.
+	* sysdeps/unix/sysv/linux/setgroups.c: New file.
+
+	[BZ #12378]
+	* posix/fnmatch_loop.c (FCT): When matching '[' keep track of beginning
+	and fall back to matching as normal character if the string ends before
+	the matching ']' is found.  This is what POSIX requires.
+	* posix/testfnm.c: Adjust test result.
+	* posix/globtest.sh: Adjust test result.  Add new test.
+	* posix/tst-fnmatch.input: Likewise.
+	* posix/tst-fnmatch2.c: Add new test.
+
 2010-12-28  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
 
 	* elf/Makefile (check-execstack): Revert last change.  Depend on

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sat Jan 15 00:03:01 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-1-13
+GNU C Library NEWS -- history of user-visible changes.  2011-1-14
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -9,10 +9,11 @@
 
 * The following bugs are resolved with this release:
 
-  3268, 7066, 10085, 10484, 10851, 11149, 11155, 11611, 11640, 11655, 11701,
-  11840, 11856, 11883, 11903, 11904, 11968, 11979, 12005, 12037, 12067,
-  12077, 12078, 12092, 12093, 12107, 12108, 12113, 12140, 12159, 12167,
-  12191, 12194, 12201, 12204, 12205, 12207, 12348, 12394, 12397
+  3268, 7066, 10085, 10484, 10563, 10851, 11149, 11155, 11611, 11640, 11655,
+  11701, 11840, 11856, 11883, 11903, 11904, 11968, 11979, 12005, 12037,
+  12067, 12077, 12078, 12092, 12093, 12107, 12108, 12113, 12140, 12159,
+  12167, 12191, 12194, 12201, 12204, 12205, 12207, 12348, 12378, 12394,
+  12397
 
 * New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
 

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Sat Jan 15 00:03:01 2011
@@ -1,3 +1,10 @@
+2011-01-14  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #10563]
+	* sysdeps/pthread/setxid.h (__SETXID_1): Add cast to assignment.
+	(__SETXID_2): Likewise.
+	(__SETXID_3): Likewise.
+
 2011-01-13  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	[BZ #10484]

Modified: fsf/trunk/libc/nptl/sysdeps/pthread/setxid.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/setxid.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/setxid.h Sat Jan 15 00:03:01 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2007, 2011 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
@@ -20,11 +20,11 @@
 #include <sysdep.h>
 
 #define __SETXID_1(cmd, arg1) \
-  cmd.id[0] = arg1
+  cmd.id[0] = (long int) arg1
 #define __SETXID_2(cmd, arg1, arg2) \
-  __SETXID_1 (cmd, arg1); cmd.id[1] = arg2
+  __SETXID_1 (cmd, arg1); cmd.id[1] = (long int) arg2
 #define __SETXID_3(cmd, arg1, arg2, arg3) \
-  __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = arg3
+  __SETXID_2 (cmd, arg1, arg2); cmd.id[2] = (long int) arg3
 
 #ifdef SINGLE_THREAD
 # define INLINE_SETXID_SYSCALL(name, nr, args...) \

Modified: fsf/trunk/libc/posix/fnmatch_loop.c
==============================================================================
--- fsf/trunk/libc/posix/fnmatch_loop.c (original)
+++ fsf/trunk/libc/posix/fnmatch_loop.c Sat Jan 15 00:03:01 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007,2010
+/* Copyright (C) 1991-1993,1996-2001,2003-2005,2007,2010,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -235,6 +235,8 @@
 	case L('['):
 	  {
 	    /* Nonzero if the sense of the character class is inverted.  */
+	    CHAR *p_init = p;
+	    CHAR *n_init = n;
 	    register int not;
 	    CHAR cold;
 	    UCHAR fn;
@@ -445,8 +447,13 @@
 		  }
 #endif
 		else if (c == L('\0'))
-		  /* [ (unterminated) loses.  */
-		  return FNM_NOMATCH;
+		  {
+		    /* [ unterminated, treat as normal character.  */
+		    p = p_init;
+		    n = n_init;
+		    c = L('[');
+		    goto normal_match;
+		  }
 		else
 		  {
 		    int is_range = 0;

Modified: fsf/trunk/libc/posix/globtest.sh
==============================================================================
--- fsf/trunk/libc/posix/globtest.sh (original)
+++ fsf/trunk/libc/posix/globtest.sh Sat Jan 15 00:03:01 2011
@@ -722,21 +722,24 @@
 ${common_objpfx}posix/globtest -c "$testdir" \
 'dir3\*/file1' 'dir3\*/file2' 'dir1/file\1_1' 'dir1/file\1_9' \
 'dir2\/' 'nondir\/' 'dir4[a/fil*1' 'di*r4[a/file2' 'dir5[ab]/file[12]' \
-'dir6/fil*[a' 'dir*6/file1[a' 'dir6/fi*l[ab]' 'dir*6/file1[ab]' |
-sort > $testout
-cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
-`di*r4[a/file2'
-`dir*6/file1[a'
+'dir6/fil*[a' 'dir*6/file1[a' 'dir6/fi*l[ab]' 'dir*6/file1[ab]' \
+'dir6/file1[[.a.]*' |
+sort > $testout
+cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
 `dir*6/file1[ab]'
 `dir1/file1_1'
 `dir1/file\1_9'
 `dir2/'
 `dir3*/file1'
 `dir3\*/file2'
-`dir4[a/fil*1'
+`dir4[a/file1'
+`dir4[a/file2'
 `dir5[ab]/file[12]'
 `dir6/fi*l[ab]'
-`dir6/fil*[a'
+`dir6/file1[a'
+`dir6/file1[a'
+`dir6/file1[a'
+`dir6/file1[ab]'
 `nondir\/'
 EOF
 HOME="$testdir" \

Modified: fsf/trunk/libc/posix/testfnm.c
==============================================================================
--- fsf/trunk/libc/posix/testfnm.c (original)
+++ fsf/trunk/libc/posix/testfnm.c Sat Jan 15 00:03:01 2011
@@ -26,7 +26,7 @@
   { "*/b", "\\*/b", 0, 0 },
   { "a/b", "\\?/b", 0, FNM_NOMATCH },
   { "?/b", "\\?/b", 0, 0 },
-  { "[/b", "[/b", 0, FNM_NOMATCH },
+  { "[/b", "[/b", 0, 0 },
   { "[/b", "\\[/b", 0, 0 },
   { "aa/b", "?""?/b", 0, 0 },
   { "aa/b", "?""?""?b", 0, 0 },

Modified: fsf/trunk/libc/posix/tst-fnmatch.input
==============================================================================
--- fsf/trunk/libc/posix/tst-fnmatch.input (original)
+++ fsf/trunk/libc/posix/tst-fnmatch.input Sat Jan 15 00:03:01 2011
@@ -1,5 +1,5 @@
 # Tests for fnmatch.
-# Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2004, 2011 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributes by Ulrich Drepper <drepper@xxxxxxxxxx>.
 #
@@ -65,10 +65,10 @@
 C		 "]"			"[][abc]"	       0
 C		 "abc]"			"[][abc]"	       NOMATCH
 C		 "[]abc"		"[][]abc"	       NOMATCH
-C		 "]"		        "[!]]"		       NOMATCH
+C		 "]"			"[!]]"		       NOMATCH
 C		 "aa]"			"[!]a]"		       NOMATCH
-C		 "]"		        "[!a]"		       0
-C		 "]]"		        "[!a]]"		       0
+C		 "]"			"[!a]"		       0
+C		 "]]"			"[!a]]"		       0
 
 # B.6 012(C)
 C		 "a"			"[[.a.]]"	       0
@@ -340,7 +340,8 @@
 # B.6 031(C)
 C		 "/$"			"\\/\\$"	       0
 C		 "/["			"\\/\\["	       0
-C		 "/["			"\\/["		       NOMATCH
+C		 "/["			"\\/["		       0
+C		 "/[]"			"\\/\\[]"	       0
 
 # B.6 032(C)
 C		 "/$"			"\\/\\$"	       NOMATCH NOESCAPE

Modified: fsf/trunk/libc/posix/tst-fnmatch2.c
==============================================================================
--- fsf/trunk/libc/posix/tst-fnmatch2.c (original)
+++ fsf/trunk/libc/posix/tst-fnmatch2.c Sat Jan 15 00:03:01 2011
@@ -28,6 +28,11 @@
       puts ("Fourth fnmatch didn't return 0");
       return 1;
     }
+  if (fnmatch ("[", "[", 0) != 0)
+    {
+      puts ("Fifth fnmatch didn't return 0");
+      return 1;
+    }
   return 0;
 }
 

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/setgroups.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/setgroups.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/setgroups.c Sat Jan 15 00:03:01 2011
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997,1998,2000,2002,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
+   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
@@ -25,6 +26,7 @@
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
+#include <setxid.h>
 #include <linux/posix_types.h>
 #include <kernel-features.h>
 
@@ -44,7 +46,7 @@
 setgroups (size_t n, const gid_t *groups)
 {
 #if __ASSUME_32BITUIDS > 0
-  return INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
+  return INLINE_SETXID_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
 #else
   if (n > (size_t) __sysconf (_SC_NGROUPS_MAX))
     {
@@ -62,7 +64,8 @@
 	  int result;
 	  int saved_errno = errno;
 
-	  result = INLINE_SYSCALL (setgroups32, 2, n, CHECK_N (groups, n));
+	  result = INLINE_SETXID_SYSCALL (setgroups32, 2, n,
+					  CHECK_N (groups, n));
 	  if (result == 0 || errno != ENOSYS)
 	    return result;
 
@@ -80,7 +83,8 @@
 	    }
 	}
 
-      return INLINE_SYSCALL (setgroups, 2, n, CHECK_N (kernel_groups, n));
+      return INLINE_SETXID_SYSCALL (setgroups, 2, n,
+				    CHECK_N (kernel_groups, n));
     }
 #endif
 }

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/setgroups.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/setgroups.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/setgroups.c Sat Jan 15 00:03:01 2011
@@ -1,0 +1,37 @@
+/* Copyright (C) 1997,1998,2000,2002,2004,2006,2011
+   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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <grp.h>
+#include <setxid.h>
+#include <sysdep.h>
+
+
+/* Set the group set for the current user to GROUPS (N of them).  For
+   Linux we must convert the array of groups into the format that the
+   kernel expects.  */
+int
+setgroups (size_t n, const gid_t *groups)
+{
+#ifdef __NR_setgroups32
+# error "wrong setgroups.c file used"
+#endif
+  return INLINE_SETXID_SYSCALL (setgroups, 2, n, groups);
+}
+libc_hidden_def (setgroups)