Accepting request 128214 from Base:System

- libreadlib: try to avoid to bind references of the symbols
  rl_instream and rl_outstream
- libreadlib: make private symbols really private

- Increase buffer for libreadline messsages if required
- Include stdio.h in libreadline header files to get the declaration
  of FILES correct.

OBS-URL: https://build.opensuse.org/request/show/128214
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bash?expand=0&rev=99
This commit is contained in:
Stephan Kulow 2012-07-18 15:12:06 +00:00 committed by Git OBS Bridge
commit 028d63100a
4 changed files with 130 additions and 4 deletions

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Wed Jul 18 11:17:00 UTC 2012 - werner@suse.de
- libreadlib: try to avoid to bind references of the symbols
rl_instream and rl_outstream
- libreadlib: make private symbols really private
-------------------------------------------------------------------
Wed Jul 18 09:20:55 UTC 2012 - werner@suse.de
- Increase buffer for libreadline messsages if required
- Include stdio.h in libreadline header files to get the declaration
of FILES correct.
-------------------------------------------------------------------
Mon Jul 9 10:54:51 UTC 2012 - werner@suse.de

View File

@ -20,10 +20,11 @@ Name: bash
BuildRequires: audit-devel
BuildRequires: autoconf
BuildRequires: bison
BuildRequires: ncurses-devel
%if %suse_version > 1020
BuildRequires: fdupes
%endif
BuildRequires: makeinfo
BuildRequires: ncurses-devel
%define bash_vers 4.2
%define rl_vers 6.2
%define extend ""
@ -80,6 +81,7 @@ Patch22: readline-6.1-wrap.patch
Patch23: readline-5.2-conf.patch
Patch24: readline-6.2-metamode.patch
Patch25: readline-6.2-endpw.dif
Patch26: readline-6.2-msgdynamic.patch
Patch30: readline-6.2-destdir.patch
Patch40: bash-4.1-bash.bashrc.dif
Patch42: audit-patch
@ -288,6 +290,7 @@ unset p
%patch23 -p0 -b .conf
%patch24 -p0 -b .metamode
#%patch25 -p0 -b .endpw
%patch26 -p0 -b .msgdy
%patch40 -p0 -b .bashrc
%patch42 -p1 -b .audit
%patch46 -p0 -b .notimestamp
@ -303,6 +306,7 @@ done
%patch23 -p2 -b .conf
%patch24 -p2 -b .metamode
#%patch25 -p2 -b .endpw
%patch26 -p2 -b .msgdy
%patch30 -p0 -b .destdir
%patch20 -p0 -b .0
@ -349,6 +353,21 @@ pushd ../readline-%{rl_vers}%{extend}
LARGEFILE="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
fi
rm -f ./test64
(cat > rl.map)<<-'EOF'
{
local:
_rl*;
xfree;
xmalloc;
xrealloc;
};
EOF
(cat > dyn.map)<<-'EOF'
{
*;
!rl_*stream;
}
EOF
CFLAGS="$RPM_OPT_FLAGS $LARGEFILE -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g"
LDFLAGS=""
cflags -std=gnu89 CFLAGS
@ -363,8 +382,9 @@ pushd ../readline-%{rl_vers}%{extend}
cflags -Wl,--as-needed LDFLAGS
cflags -Wl,-O2 LDFLAGS
cflags -Wl,--hash-size=8599 LDFLAGS
cflags -Wl,-Bsymbolic-functions LDFLAGS
cflags -Wl,-rpath,%{_ldldir}/%{bash_vers} LDFLAGS
cflags -Wl,--version-script=${PWD}/rl.map LDFLAGS
cflags -Wl,--dynamic-list=${PWD}/dyn.map LDFLAGS
CC=gcc
CC_FOR_BUILD="$CC"
CFLAGS_FOR_BUILD="$CFLAGS"
@ -383,6 +403,9 @@ pushd ../readline-%{rl_vers}%{extend}
ln -sf shlib/libreadline.so.%{rl_vers} libreadline.so.%{rl_major}
ln -sf shlib/libhistory.so.%{rl_vers} libhistory.so
ln -sf shlib/libhistory.so.%{rl_vers} libhistory.so.%{rl_major}
LDFLAGS=${LDFLAGS/-Wl,--version-script=*rl.map/}
LDFLAGS=${LDFLAGS/-Wl,--dynamic-list=*dyn.map/}
LDFLAGS_FOR_BUILD="$LDFLAGS"
popd
# /proc is required for correct configuration
test -d /dev/fd || { echo "/proc is not mounted!" >&2; exit 1; }

View File

@ -0,0 +1,71 @@
--- lib/readline/display.c
+++ lib/readline/display.c 2012-07-18 08:04:36.456009352 +0000
@@ -176,7 +176,8 @@ int _rl_vis_botlin = 0;
static int last_lmargin;
/* A buffer for `modeline' messages. */
-static char msg_buf[128];
+static char *msg_buf;
+static size_t msg_buf_sz = 128;
/* Non-zero forces the redisplay even if we thought it was unnecessary. */
static int forced_display;
@@ -2139,6 +2140,32 @@ rl_message (va_alist)
#if defined (PREFER_VARARGS)
char *format;
#endif
+#if defined (HAVE_VSNPRINTF)
+ int vsnprbytes;
+#endif
+
+ if (!msg_buf)
+ msg_buf = xmalloc(msg_buf_sz);
+
+#if defined (HAVE_VSNPRINTF)
+ do
+ {
+ va_end (args);
+#if defined (PREFER_STDARG)
+ va_start (args, format);
+#else
+ va_start (args);
+ format = va_arg (args, char *);
+#endif
+ vsnprbytes = vsnprintf (msg_buf, msg_buf_sz - 1, format, args);
+ if (vsnprbytes < msg_buf_sz - 1)
+ break;
+
+ msg_buf_sz += 64;
+ msg_buf = xrealloc (msg_buf, msg_buf_sz);
+ }
+ while (1);
+#else
#if defined (PREFER_STDARG)
va_start (args, format);
@@ -2147,11 +2174,8 @@ rl_message (va_alist)
format = va_arg (args, char *);
#endif
-#if defined (HAVE_VSNPRINTF)
- vsnprintf (msg_buf, sizeof (msg_buf) - 1, format, args);
-#else
vsprintf (msg_buf, format, args);
- msg_buf[sizeof(msg_buf) - 1] = '\0'; /* overflow? */
+ msg_buf[msg_buf_sz - 1] = '\0'; /* overflow? */
#endif
va_end (args);
@@ -2176,8 +2200,11 @@ int
rl_message (format, arg1, arg2)
char *format;
{
+ if (!msg_buf)
+ msg_buf = xmalloc(msg_buf_sz);
+
sprintf (msg_buf, format, arg1, arg2);
- msg_buf[sizeof(msg_buf) - 1] = '\0'; /* overflow? */
+ msg_buf[msg_buf_sz - 1] = '\0'; /* overflow? */
rl_display_prompt = msg_buf;
if (saved_local_prompt == 0)

View File

@ -49,6 +49,16 @@
{
/* Null usernames should result in all users as possible completions. */
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
--- history.h
+++ history.h 2012-07-18 08:06:55.693903477 +0000
@@ -32,6 +32,7 @@ extern "C" {
# include "rlstdc.h"
# include "rltypedefs.h"
#else
+# include <stdio.h>
# include <readline/rlstdc.h>
# include <readline/rltypedefs.h>
#endif
--- readline.c
+++ readline.c 2005-12-09 17:09:26.000000000 +0100
@@ -767,7 +767,11 @@ _rl_dispatch_subseq (key, map, got_subse
@ -65,8 +75,16 @@
rl_executing_keymap = map;
--- readline.h
+++ readline.h 2005-12-09 17:09:26.000000000 +0100
@@ -448,7 +448,7 @@ extern char *rl_filename_completion_func
+++ readline.h 2012-07-18 08:07:11.560009784 +0000
@@ -32,6 +32,7 @@ extern "C" {
# include "keymaps.h"
# include "tilde.h"
#else
+# include <stdio.h>
# include <readline/rlstdc.h>
# include <readline/rltypedefs.h>
# include <readline/keymaps.h>
@@ -448,7 +449,7 @@ extern char *rl_filename_completion_func
extern int rl_completion_mode PARAMS((rl_command_func_t *));