1 |
ulm 12/07/05 15:05:42 |
2 |
|
3 |
Added: 04_all_gnulib-gets.patch |
4 |
Log: |
5 |
Fix compilation with glibc-2.16. |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 src/patchsets/emacs/24.1/04_all_gnulib-gets.patch |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/24.1/04_all_gnulib-gets.patch?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/emacs/24.1/04_all_gnulib-gets.patch?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: 04_all_gnulib-gets.patch |
14 |
=================================================================== |
15 |
Fix compilation with glibc-2.16. |
16 |
https://bugs.gentoo.org/424755 |
17 |
|
18 |
Patch backported from gnulib upstream: |
19 |
|
20 |
From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001 |
21 |
From: Eric Blake <eblake@××××××.com> |
22 |
Date: Thu, 29 Mar 2012 13:30:41 -0600 |
23 |
Subject: [PATCH 1/1] stdio: don't assume gets any more |
24 |
|
25 |
Gnulib intentionally does not have a gets module, and now that C11 |
26 |
and glibc have dropped it, we should be more proactive about warning |
27 |
any user on a platform that still has a declaration of this dangerous |
28 |
interface. |
29 |
|
30 |
--- emacs-24.1-orig/lib/gnulib.mk |
31 |
+++ emacs-24.1/lib/gnulib.mk |
32 |
@@ -599,7 +624,6 @@ |
33 |
-e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ |
34 |
-e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ |
35 |
-e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ |
36 |
- -e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \ |
37 |
-e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ |
38 |
-e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ |
39 |
-e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ |
40 |
--- emacs-24.1-orig/lib/stdio.in.h |
41 |
+++ emacs-24.1/lib/stdio.in.h |
42 |
@@ -699,22 +699,11 @@ |
43 |
# endif |
44 |
#endif |
45 |
|
46 |
-#if @GNULIB_GETS@ |
47 |
-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ |
48 |
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
49 |
-# undef gets |
50 |
-# define gets rpl_gets |
51 |
-# endif |
52 |
-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1))); |
53 |
-_GL_CXXALIAS_RPL (gets, char *, (char *s)); |
54 |
-# else |
55 |
-_GL_CXXALIAS_SYS (gets, char *, (char *s)); |
56 |
-# undef gets |
57 |
-# endif |
58 |
-_GL_CXXALIASWARN (gets); |
59 |
/* It is very rare that the developer ever has full control of stdin, |
60 |
- so any use of gets warrants an unconditional warning. Assume it is |
61 |
- always declared, since it is required by C89. */ |
62 |
+ so any use of gets warrants an unconditional warning; besides, C11 |
63 |
+ removed it. */ |
64 |
+#undef gets |
65 |
+#if HAVE_RAW_DECL_GETS |
66 |
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); |
67 |
#endif |
68 |
|
69 |
@@ -1054,9 +1043,9 @@ |
70 |
# endif |
71 |
#endif |
72 |
|
73 |
-/* Some people would argue that sprintf should be handled like gets |
74 |
- (for example, OpenBSD issues a link warning for both functions), |
75 |
- since both can cause security holes due to buffer overruns. |
76 |
+/* Some people would argue that all sprintf uses should be warned about |
77 |
+ (for example, OpenBSD issues a link warning for it), |
78 |
+ since it can cause security holes due to buffer overruns. |
79 |
However, we believe that sprintf can be used safely, and is more |
80 |
efficient than snprintf in those safe cases; and as proof of our |
81 |
belief, we use sprintf in several gnulib modules. So this header |
82 |
--- emacs-24.1-orig/m4/stdio_h.m4 |
83 |
+++ emacs-24.1/m4/stdio_h.m4 |
84 |
@@ -1,4 +1,4 @@ |
85 |
-# stdio_h.m4 serial 40 |
86 |
+# stdio_h.m4 serial 41 |
87 |
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc. |
88 |
dnl This file is free software; the Free Software Foundation |
89 |
dnl gives unlimited permission to copy and/or distribute it, |
90 |
@@ -18,7 +18,6 @@ |
91 |
GNULIB_GETC=1 |
92 |
GNULIB_GETCHAR=1 |
93 |
GNULIB_FGETS=1 |
94 |
- GNULIB_GETS=1 |
95 |
GNULIB_FREAD=1 |
96 |
dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c" |
97 |
dnl "expected source file, required through AC_LIBSOURCES, not found". It is |
98 |
@@ -72,10 +71,10 @@ |
99 |
|
100 |
dnl Check for declarations of anything we want to poison if the |
101 |
dnl corresponding gnulib module is not in use, and which is not |
102 |
- dnl guaranteed by C89. |
103 |
+ dnl guaranteed by both C89 and C11. |
104 |
gl_WARN_ON_USE_PREPARE([[#include <stdio.h> |
105 |
- ]], [dprintf fpurge fseeko ftello getdelim getline pclose popen renameat |
106 |
- snprintf tmpfile vdprintf vsnprintf]) |
107 |
+ ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen |
108 |
+ renameat snprintf tmpfile vdprintf vsnprintf]) |
109 |
]) |
110 |
|
111 |
AC_DEFUN([gl_STDIO_MODULE_INDICATOR], |
112 |
@@ -113,7 +112,6 @@ |
113 |
GNULIB_GETCHAR=0; AC_SUBST([GNULIB_GETCHAR]) |
114 |
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM]) |
115 |
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE]) |
116 |
- GNULIB_GETS=0; AC_SUBST([GNULIB_GETS]) |
117 |
GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) |
118 |
GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) |
119 |
GNULIB_PCLOSE=0; AC_SUBST([GNULIB_PCLOSE]) |