From 06c13ab372b603ffdfb77dfc231e251670ab5845029bb985a58e0af3e06103d8 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 16 Oct 2015 13:29:33 +0000 Subject: [PATCH 1/3] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=210 --- bash.changes | 6 ++++++ bash.spec | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bash.changes b/bash.changes index dbfef48..84f8c89 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 16 13:02:27 UTC 2015 - werner@suse.de + +- Remove --hash-size options as there is no any change in the final + binary nor library anymore + ------------------------------------------------------------------- Mon Aug 31 11:23:11 UTC 2015 - werner@suse.de diff --git a/bash.spec b/bash.spec index 2244abe..7bf60d6 100644 --- a/bash.spec +++ b/bash.spec @@ -442,7 +442,6 @@ pushd ../readline-%{rl_vers}%{extend} cflags -DIMPORT_FUNCTIONS_DEF=0 CFLAGS cflags -Wl,--as-needed LDFLAGS cflags -Wl,-O2 LDFLAGS - cflags -Wl,--hash-size=8599 LDFLAGS cflags -Wl,-rpath,%{_ldldir}/%{bash_vers} LDFLAGS cflags -Wl,--version-script=${PWD}/rl.map LDFLAGS cflags -Wl,--dynamic-list=${PWD}/dyn.map LDFLAGS @@ -474,7 +473,6 @@ popd ln -sf ../readline-%{rl_vers} readline LD_LIBRARY_PATH=$PWD/../readline-%{rl_vers} export LD_LIBRARY_PATH - LDFLAGS="${LDFLAGS/hash-size=8599/hash-size=16699}" CC="gcc -I$PWD -L$PWD/../readline-%{rl_vers}" %if %_minsh cflags -Os CFLAGS From d56075aabddacc56ee930568bbcf32027ca6760d2fb5a1acf06b43adcf8eb039 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 16 Oct 2015 16:53:55 +0000 Subject: [PATCH 2/3] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=211 --- bash.spec | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/bash.spec b/bash.spec index 7bf60d6..70ad18f 100644 --- a/bash.spec +++ b/bash.spec @@ -397,13 +397,7 @@ pushd ../readline-%{rl_vers}%{extend} esac set +o noclobber } - echo 'int main () { return !(sizeof(void*) >= 8); }' | gcc -x c -o test64 - - if ./test64 ; then - LARGEFILE="" - else - LARGEFILE="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" - fi - rm -f ./test64 + LARGEFILE="$(getconf LFS_CFLAGS)" (cat > dyn.map)<<-'EOF' { *; From 2903e3bd4e5234bba5af054de39aeb0dd9e853b177050d66badbb86884c8b84c Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 19 Oct 2015 13:43:05 +0000 Subject: [PATCH 3/3] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=212 --- bash-4.3-pathtemp.patch | 91 +++++++++++++++++++++++++++++++++++++++++ bash-4.3.dif | 11 +++++ bash.changes | 9 ++++ bash.spec | 3 ++ 4 files changed, 114 insertions(+) create mode 100644 bash-4.3-pathtemp.patch diff --git a/bash-4.3-pathtemp.patch b/bash-4.3-pathtemp.patch new file mode 100644 index 0000000..7b2f7ef --- /dev/null +++ b/bash-4.3-pathtemp.patch @@ -0,0 +1,91 @@ +--- + lib/sh/tmpfile.c | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +--- lib/sh/tmpfile.c ++++ lib/sh/tmpfile.c 2015-10-19 13:35:30.869518731 +0000 +@@ -36,6 +36,14 @@ + #include + #include + ++#if defined(__linux__) ++# include ++# include ++# ifndef TMPFS_MAGIC ++# define TMPFS_MAGIC 0x01021994 ++# endif ++#endif ++ + #include + + #ifndef errno +@@ -60,6 +68,8 @@ static unsigned long filenum = 1L; + static char * + get_sys_tmpdir () + { ++ static int doshm; ++ + if (sys_tmpdir) + return sys_tmpdir; + +@@ -86,6 +96,31 @@ get_sys_tmpdir () + return sys_tmpdir; + } + ++#if defined(__linux__) ++static int ++emergency_sys_tmpdir () ++{ ++ static char *shm = "/dev/shm"; ++ static size_t pgsz; ++ struct statfs fs; ++ static int doshm; ++ ++ if (getuid() != 0) ++ return 0; ++ ++ if (doshm) ++ return 0; ++ ++ doshm++; ++ ++ if (statfs(shm, &fs) < 0 || fs.f_type != TMPFS_MAGIC || eaccess(shm, W_OK|X_OK)) ++ return 0; ++ ++ sys_tmpdir = shm; ++ return 1; ++} ++#endif ++ + static char * + get_tmpdir (flags) + int flags; +@@ -164,6 +199,7 @@ sh_mktmpfd (nameroot, flags, namep) + int fd, tdlen; + + filename = (char *)xmalloc (PATH_MAX + 1); ++enospace: + tdir = get_tmpdir (flags); + tdlen = strlen (tdir); + +@@ -177,6 +213,10 @@ sh_mktmpfd (nameroot, flags, namep) + free (filename); + filename = NULL; + } ++ ++ if (fd < 0 && errno == ENOSPC && emergency_sys_tmpdir()) ++ goto enospace; ++ + if (namep) + *namep = filename; + return fd; +@@ -194,6 +234,9 @@ sh_mktmpfd (nameroot, flags, namep) + } + while (fd < 0 && errno == EEXIST); + ++ if (fd < 0 && errno == ENOSPC && emergency_sys_tmpdir()) ++ goto enospace; ++ + if (namep) + *namep = filename; + else diff --git a/bash-4.3.dif b/bash-4.3.dif index 0405a0d..aa8d415 100644 --- a/bash-4.3.dif +++ b/bash-4.3.dif @@ -49,6 +49,17 @@ /* Define if you want the case-capitalizing operators (~[~]) and the `capcase' variable attribute (declare -c). */ +@@ -132,3 +136,10 @@ + /* Define to 1 if you want to be able to export indexed arrays to processes + using the foo=([0]=one [1]=two) and so on */ + /* #define ARRAY_EXPORT 1 */ ++ ++#ifndef USE_MKTEMP ++# define USE_MKTEMP ++#endif ++#ifndef USE_MKSTEMP ++# define USE_MKSTEMP ++#endif --- doc/Makefile.in +++ doc/Makefile.in 2006-03-27 12:15:25.000000000 +0000 @@ -146,7 +146,7 @@ BASHREF_FILES = $(srcdir)/bashref.texi $ diff --git a/bash.changes b/bash.changes index 84f8c89..018bde9 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Oct 19 13:38:58 UTC 2015 - werner@suse.de + +- Define the USE_MKTEMP and USE_MKSTEMP cpp macros as the + implementation is already there. +- Add patch bash-4.3-pathtemp.patch to allow root to clear the + file systems. Otherwise the completion does not work if /tmp + if full (ENOSPC for here documents) + ------------------------------------------------------------------- Fri Oct 16 13:02:27 UTC 2015 - werner@suse.de diff --git a/bash.spec b/bash.spec index 70ad18f..3ff9908 100644 --- a/bash.spec +++ b/bash.spec @@ -99,6 +99,8 @@ Patch46: man2html-no-timestamp.patch Patch47: bash-4.3-perl522.patch # PATCH-FIX-SUSE Patch48: bash-4.3-extra-import-func.patch +# PATCH-EXTEND-SUSE Allow root to clean file system if filled up +Patch49: bash-4.3-pathtemp.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _incdir %{_includedir} @@ -319,6 +321,7 @@ done %if %{with import_function} %patch48 %endif +%patch49 %patch0 -p0 -b .0 pushd ../readline-%{rl_vers}%{extend} for patch in ../readline-%{rl_vers}-patches/*; do