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

[commits] r13853 - in /fsf/trunk/libc: ChangeLog NEWS login/programs/pt_chown.c misc/error.c misc/pselect.c posix/regex.h stdlib/putenv.c



Author: eglibc
Date: Mon May 16 07:48:59 2011
New Revision: 13853

Log:
Import glibc-mainline for 2011-05-16

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/login/programs/pt_chown.c
    fsf/trunk/libc/misc/error.c
    fsf/trunk/libc/misc/pselect.c
    fsf/trunk/libc/posix/regex.h
    fsf/trunk/libc/stdlib/putenv.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon May 16 07:48:59 2011
@@ -1,4 +1,24 @@
 2011-05-16  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* posix/regex.h (RE_SYNTAX_AWK, RE_SYNTAX_GNU_AWK,
+	RE_SYNTAX_POSIX_AWK): Update to match recent development.
+	Patch by Aharon Robbins <arnold@xxxxxxxxxx>.
+
+	[BZ #11892]
+	* stdlib/putenv.c (putenv): Don't always create copy of the variable
+	on the stack.
+
+	[BZ #11895]
+	* misc/pselect.c (__pselect): Handle timeout value errors hidden
+	through underflows.
+
+	[BZ #12766]
+	* misc/error.c (error_at_line): Ensure file_name and old_file_name
+	point to strings before performing equality test for error_one_per_line
+	mode.
+
+	[BZ #11697]
+	* login/programs/pt_chown.c (do_pt_chown): Always call chown.
 
 	[BZ #11820]
 	* sysdeps/unix/sysv/linux/x86_64/sys/user.h

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Mon May 16 07:48:59 2011
@@ -10,12 +10,13 @@
 * The following bugs are resolved with this release:
 
   386, 6420, 7101, 9730, 9732, 9809, 10138, 10149, 10157, 11257, 11258,
-  11487, 11532, 11578, 11653, 11668, 11724, 11820, 11901, 11945, 11947,
-  11952, 11987, 12052, 12083, 12158, 12178, 12200, 12346, 12393, 12420,
-  12432, 12445, 12449, 12453, 12454, 12460, 12469, 12489, 12509, 12510,
-  12511, 12518, 12527, 12541, 12545, 12551, 12582, 12583, 12587, 12597,
-  12601, 12611, 12625, 12626, 12631, 12650, 12653, 12655, 12660, 12681,
-  12685, 12711, 12713, 12714, 12717, 12723, 12724, 12734, 12738, 12746
+  11487, 11532, 11578, 11653, 11668, 11697, 11724, 11820, 11892, 11895,
+  11901, 11945, 11947, 11952, 11987, 12052, 12083, 12158, 12178, 12200,
+  12346, 12393, 12420, 12432, 12445, 12449, 12453, 12454, 12460, 12469,
+  12489, 12509, 12510, 12511, 12518, 12527, 12541, 12545, 12551, 12582,
+  12583, 12587, 12597, 12601, 12611, 12625, 12626, 12631, 12650, 12653,
+  12655, 12660, 12681, 12685, 12711, 12713, 12714, 12717, 12723, 12724,
+  12734, 12738, 12746, 12766
 
 * The RPC implementation in libc is obsoleted.  Old programs keep working
   but new programs cannot be linked with the routines in libc anymore.

Modified: fsf/trunk/libc/login/programs/pt_chown.c
==============================================================================
--- fsf/trunk/libc/login/programs/pt_chown.c (original)
+++ fsf/trunk/libc/login/programs/pt_chown.c Mon May 16 07:48:59 2011
@@ -64,7 +64,7 @@
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "1999");
+"), "2011");
 }
 
 static char *
@@ -123,7 +123,7 @@
 
   /* Set the owner to the real user ID, and the group to that special
      group ID.  */
-  if (st.st_gid != gid && chown (pty, getuid (), gid) < 0)
+  if (chown (pty, getuid (), gid) < 0)
     return FAIL_EACCES;
 
   /* Set the permission mode to readable and writable by the owner,

Modified: fsf/trunk/libc/misc/error.c
==============================================================================
--- fsf/trunk/libc/misc/error.c (original)
+++ fsf/trunk/libc/misc/error.c Mon May 16 07:48:59 2011
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-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
@@ -272,7 +272,9 @@
 
       if (old_line_number == line_number
 	  && (file_name == old_file_name
-	      || strcmp (old_file_name, file_name) == 0))
+	      || (old_file_name != NULL
+		  && file_name != NULL
+		  && strcmp (old_file_name, file_name) == 0)))
 	/* Simply return and print nothing.  */
 	return;
 

Modified: fsf/trunk/libc/misc/pselect.c
==============================================================================
--- fsf/trunk/libc/misc/pselect.c (original)
+++ fsf/trunk/libc/misc/pselect.c Mon May 16 07:48:59 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1998,2001,2002,2003,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998,2001-2003,2006,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -43,7 +43,17 @@
      precision and therefore the `pselect` should be available.  But
      for now it is hardly found.  */
   if (timeout != NULL)
-    TIMESPEC_TO_TIMEVAL (&tval, timeout);
+    {
+      /* Catch bugs which would be hidden by the TIMESPEC_TO_TIMEVAL
+	 computations.  The division by 1000 truncates values.  */
+      if (__builtin_expect (timeout->tv_nsec < 0, 0))
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+
+      TIMESPEC_TO_TIMEVAL (&tval, timeout);
+    }
 
   /* The setting and restoring of the signal mask and the select call
      should be an atomic operation.  This can't be done without kernel

Modified: fsf/trunk/libc/posix/regex.h
==============================================================================
--- fsf/trunk/libc/posix/regex.h (original)
+++ fsf/trunk/libc/posix/regex.h Mon May 16 07:48:59 2011
@@ -1,6 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006,2008
+   Copyright (C) 1985,1989-93,1995-98,2000,2001,2002,2003,2005,2006,2008,2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -62,10 +62,10 @@
 /* If this bit is set, then ^ and $ are always anchors (outside bracket
      expressions, of course).
    If this bit is not set, then it depends:
-        ^  is an anchor if it is at the beginning of a regular
-           expression or after an open-group or an alternation operator;
-        $  is an anchor if it is at the end of a regular expression, or
-           before a close-group or an alternation operator.
+	^  is an anchor if it is at the beginning of a regular
+	   expression or after an open-group or an alternation operator;
+	$  is an anchor if it is at the end of a regular expression, or
+	   before a close-group or an alternation operator.
 
    This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
    POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -194,16 +194,19 @@
    | RE_NO_BK_PARENS              | RE_NO_BK_REFS			\
    | RE_NO_BK_VBAR                | RE_NO_EMPTY_RANGES			\
    | RE_DOT_NEWLINE		  | RE_CONTEXT_INDEP_ANCHORS		\
+   | RE_CHAR_CLASSES							\
    | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
 
 #define RE_SYNTAX_GNU_AWK						\
-  ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG)	\
-   & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS		\
-       | RE_CONTEXT_INVALID_OPS ))
+  ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS		\
+    | RE_INVALID_INTERVAL_ORD)						\
+   & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS				\
+      | RE_CONTEXT_INVALID_OPS ))
 
 #define RE_SYNTAX_POSIX_AWK						\
   (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS		\
-   | RE_INTERVALS	    | RE_NO_GNU_OPS)
+   | RE_INTERVALS	    | RE_NO_GNU_OPS				\
+   | RE_INVALID_INTERVAL_ORD)
 
 #define RE_SYNTAX_GREP							\
   (RE_BK_PLUS_QM              | RE_CHAR_CLASSES				\

Modified: fsf/trunk/libc/stdlib/putenv.c
==============================================================================
--- fsf/trunk/libc/stdlib/putenv.c (original)
+++ fsf/trunk/libc/stdlib/putenv.c Mon May 16 07:48:59 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 94, 95, 96, 97, 98, 99, 11 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
@@ -57,14 +57,31 @@
 
   if (name_end != NULL)
     {
+      char *name;
 #ifdef _LIBC
-      char *name = strndupa (string, name_end - string);
+      int use_malloc = !__libc_use_alloca (name_end - string + 1);
+      if (__builtin_expect (use_malloc, 0))
+	{
+	  name = strndup (string, name_end - string);
+	  if (name == NULL)
+	    return -1;
+	}
+      else
+	name = strndupa (string, name_end - string);
 #else
-      char *name = alloca (name_end - string + 1);
+# define use_malloc 1
+      name = malloc (name_end - string + 1);
+      if (name == NULL)
+	return -1;
       memcpy (name, string, name_end - string);
       name[name_end - string] = '\0';
 #endif
-      return __add_to_environ (name, NULL, string, 1);
+      int result = __add_to_environ (name, NULL, string, 1);
+
+      if (__builtin_expect (use_malloc, 0))
+	free (name);
+
+      return result;
     }
 
   __unsetenv (string);