Accepting request 569479 from Base:System

- Modify patch bash-4.3-pathtemp.patch to avoid crash at full
  file system (boo#1076909)

OBS-URL: https://build.opensuse.org/request/show/569479
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bash?expand=0&rev=141
This commit is contained in:
Dominique Leuenberger 2018-01-29 13:54:57 +00:00 committed by Git OBS Bridge
commit 324187c675
3 changed files with 22 additions and 10 deletions

View File

@ -1,9 +1,9 @@
--- ---
lib/sh/tmpfile.c | 43 +++++++++++++++++++++++++++++++++++++++++++ lib/sh/tmpfile.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 43 insertions(+) 1 file changed, 48 insertions(+), 1 deletion(-)
--- lib/sh/tmpfile.c --- 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 @@ @@ -36,6 +36,14 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
@ -60,14 +60,16 @@
static char * static char *
get_tmpdir (flags) get_tmpdir (flags)
int 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; int fd, tdlen;
-
filename = (char *)xmalloc (PATH_MAX + 1); +
+enospace: +enospace:
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags); tdir = get_tmpdir (flags);
tdlen = strlen (tdir); tdlen = strlen (tdir);
@@ -201,6 +237,10 @@ sh_mktmpfd (nameroot, flags, namep) @@ -201,6 +237,10 @@ sh_mktmpfd (nameroot, flags, namep)
free (filename); free (filename);
filename = NULL; filename = NULL;
@ -79,12 +81,16 @@
if (namep) if (namep)
*namep = filename; *namep = filename;
return fd; 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); while (fd < 0 && errno == EEXIST);
+ if (fd < 0 && errno == ENOSPC && emergency_sys_tmpdir()) + if (fd < 0 && errno == ENOSPC && emergency_sys_tmpdir())
+ goto enospace; + {
+ free (filename);
+ filename = NULL;
+ goto enospace;
+ }
+ +
if (namep) if (namep)
*namep = filename; *namep = filename;

View File

@ -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 Fri Dec 8 06:12:43 UTC 2017 - werner@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package bash # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed