r3231 - in glibc-package/branches/glibc-2.9/debian: . patches patches/any
Author: schizo
Date: 2009-01-11 07:20:36 +0000 (Sun, 11 Jan 2009)
New Revision: 3231
Added:
glibc-package/branches/glibc-2.9/debian/patches/any/cvs-bz9706-nss_nss-files_files-parse.diff
Modified:
glibc-package/branches/glibc-2.9/debian/changelog
glibc-package/branches/glibc-2.9/debian/patches/series
Log:
* patches/any/cvs-bz9706-nss_nss-files_files-parse.diff: unify NSS
behavior between 32-bit and 64-bit platforms. closes: #483645.
Modified: glibc-package/branches/glibc-2.9/debian/changelog
===================================================================
--- glibc-package/branches/glibc-2.9/debian/changelog 2009-01-10 23:51:47 UTC (rev 3230)
+++ glibc-package/branches/glibc-2.9/debian/changelog 2009-01-11 07:20:36 UTC (rev 3231)
@@ -61,6 +61,8 @@
closes: #510219.
* patches/localedata/submitted-bz9725-locale-sv_SE.diff: fix from David
Weinehall for incorrect sv_SE date format. closes: #489960.
+ * patches/any/cvs-bz9706-nss_nss-files_files-parse.diff: unify NSS
+ behavior between 32-bit and 64-bit platforms. closes: #483645.
-- Clint Adams <schizo@debian.org> Fri, 09 Jan 2009 12:38:28 -0500
Added: glibc-package/branches/glibc-2.9/debian/patches/any/cvs-bz9706-nss_nss-files_files-parse.diff
===================================================================
--- glibc-package/branches/glibc-2.9/debian/patches/any/cvs-bz9706-nss_nss-files_files-parse.diff (rev 0)
+++ glibc-package/branches/glibc-2.9/debian/patches/any/cvs-bz9706-nss_nss-files_files-parse.diff 2009-01-11 07:20:36 UTC (rev 3231)
@@ -0,0 +1,46 @@
+diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
+index 3ba37c8..66615da 100644
+--- a/nss/nss_files/files-parse.c
++++ b/nss/nss_files/files-parse.c
+@@ -1,5 +1,5 @@
+ /* Common code for file-based database parsers in nss_files module.
+- Copyright (C) 1996-2000, 2003, 2004 Free Software Foundation, Inc.
++ Copyright (C) 1996-2000, 2003, 2004, 2009 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
+@@ -127,10 +127,24 @@ nss_files_parse_hidden_def (parse_line)
+ } \
+ }
+
++/* Helper function. */
++static inline uint32_t
++__attribute__ ((always_inline))
++strtou32 (const char *nptr, char **endptr, int base)
++{
++ unsigned long int val = strtoul (nptr, endptr, base);
++
++ /* Match the 32-bit behavior on 64-bit platforms. */
++ if (sizeof (long int) > 4 && val > 0xffffffff)
++ val = 0xffffffff;
++
++ return val;
++}
++
+ # define INT_FIELD(variable, terminator_p, swallow, base, convert) \
+ { \
+ char *endp; \
+- variable = convert (strtoul (line, &endp, base)); \
++ variable = convert (strtou32 (line, &endp, base)); \
+ if (endp == line) \
+ return 0; \
+ else if (terminator_p (*endp)) \
+@@ -148,7 +162,7 @@ nss_files_parse_hidden_def (parse_line)
+ if (*line == '\0') \
+ /* We expect some more input, so don't allow the string to end here. */ \
+ return 0; \
+- variable = convert (strtoul (line, &endp, base)); \
++ variable = convert (strtou32 (line, &endp, base)); \
+ if (endp == line) \
+ variable = default; \
+ if (terminator_p (*endp)) \
Modified: glibc-package/branches/glibc-2.9/debian/patches/series
===================================================================
--- glibc-package/branches/glibc-2.9/debian/patches/series 2009-01-10 23:51:47 UTC (rev 3230)
+++ glibc-package/branches/glibc-2.9/debian/patches/series 2009-01-11 07:20:36 UTC (rev 3231)
@@ -165,3 +165,4 @@
any/local-missing-linux_types.h.diff
any/cvs-bz697-posix-regexec.diff
any/cvs-bz9697-posix-regcomp.diff
+any/cvs-bz9706-nss_nss-files_files-parse.diff
Reply to: