From efc24a4967d83244a6efef3cb0c1b517bac871df Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 24 Jan 2018 12:42:37 +0000 Subject: [PATCH] Add fix for boo#1076909 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=246 --- bash-4.3-pathtemp.patch | 24 +++++++++++++++--------- bash.changes | 6 ++++++ bash.spec | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/bash-4.3-pathtemp.patch b/bash-4.3-pathtemp.patch index 9b5cc2ed..6727f18a 100644 --- a/bash-4.3-pathtemp.patch +++ b/bash-4.3-pathtemp.patch @@ -1,9 +1,9 @@ --- - lib/sh/tmpfile.c | 43 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 43 insertions(+) + lib/sh/tmpfile.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 48 insertions(+), 1 deletion(-) --- lib/sh/tmpfile.c -+++ lib/sh/tmpfile.c 2016-07-14 12:22:06.681051058 +0000 ++++ lib/sh/tmpfile.c 2018-01-24 12:38:42.410481352 +0000 @@ -36,6 +36,14 @@ #include #include @@ -60,14 +60,16 @@ static char * get_tmpdir (flags) int flags; -@@ -188,6 +223,7 @@ sh_mktmpfd (nameroot, flags, namep) +@@ -186,7 +221,8 @@ sh_mktmpfd (nameroot, flags, namep) + { + char *filename, *tdir, *lroot; int fd, tdlen; - - filename = (char *)xmalloc (PATH_MAX + 1); +- ++ +enospace: + filename = (char *)xmalloc (PATH_MAX + 1); tdir = get_tmpdir (flags); tdlen = strlen (tdir); - @@ -201,6 +237,10 @@ sh_mktmpfd (nameroot, flags, namep) free (filename); filename = NULL; @@ -79,12 +81,16 @@ if (namep) *namep = filename; return fd; -@@ -219,6 +259,9 @@ sh_mktmpfd (nameroot, flags, namep) +@@ -219,6 +259,13 @@ sh_mktmpfd (nameroot, flags, namep) } while (fd < 0 && errno == EEXIST); + if (fd < 0 && errno == ENOSPC && emergency_sys_tmpdir()) -+ goto enospace; ++ { ++ free (filename); ++ filename = NULL; ++ goto enospace; ++ } + if (namep) *namep = filename; diff --git a/bash.changes b/bash.changes index 6b8d4249..11b0686c 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 24 12:40:17 UTC 2018 - werner@suse.de + +- Modify patch bash-4.3-pathtemp.patch to avoid crash at full + file system (boo#1076909) + ------------------------------------------------------------------- Fri Dec 8 06:12:43 UTC 2017 - werner@suse.de diff --git a/bash.spec b/bash.spec index 935dade2..dbf44ce5 100644 --- a/bash.spec +++ b/bash.spec @@ -1,7 +1,7 @@ # # spec file for package bash # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed