diff --git a/tcsh-6.18.01-history-stderror-jmp.patch b/tcsh-6.18.01-history-stderror-jmp.patch new file mode 100644 index 0000000..90d2122 --- /dev/null +++ b/tcsh-6.18.01-history-stderror-jmp.patch @@ -0,0 +1,49 @@ +--- + sh.c | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +--- sh.c ++++ sh.c 2019-09-26 07:54:47.733054241 +0000 +@@ -1563,13 +1563,15 @@ srcfile(const char *f, int onlyown, int + fl.l_len = 0; + + hd = xmalloc(sizeof(*hd)); +- cleanup_push(hd, xfree); ++ if (hd) { ++ cleanup_push(hd, xfree); + +- *hd = fcntl(unit, F_DUPFD_CLOEXEC, FSAFE+1); +- cleanup_push(hd, open_cleanup); ++ *hd = fcntl(unit, F_DUPFD_CLOEXEC, FSAFE+1); ++ cleanup_push(hd, open_cleanup); + +- fcntl(*hd, F_SETLKW, &fl); +- cleanup_push(hd, fcntl_cleanup); ++ fcntl(*hd, F_SETLKW, &fl); ++ cleanup_push(hd, fcntl_cleanup); ++ } + } + + cleanup_push(&unit, open_cleanup); +@@ -2229,6 +2231,7 @@ dosource_flg(Char **t, struct command *c + char *file; + int fd; + int newflg = 0; ++ size_t omark; + + USE(c); + t++; +@@ -2249,9 +2252,12 @@ dosource_flg(Char **t, struct command *c + xfree(f); + t = glob_all_or_error(t); + cleanup_push(t, blk_cleanup); ++ omark = cleanup_push_mark(); + fd = srcfile(file, 0, (flg | newflg), t); +- if ((!fd) && (!newflg) && (!bequiet)) ++ if ((!fd) && (!newflg) && (!bequiet)) { ++ omark = cleanup_push_mark(); + stderror(ERR_SYSTEM, file, strerror(errno)); ++ } + /* We need to preserve fd and it's cleaning routines on the top of the + * cleaning stack. Don't call cleanup_until() but clean it manually. */ + cleanup_ignore(file); diff --git a/tcsh.changes b/tcsh.changes index 38ec6e8..aaa099d 100644 --- a/tcsh.changes +++ b/tcsh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 26 07:39:20 UTC 2019 - Dr. Werner Fink + +- Add patch tcsh-6.18.01-history-stderror-jmp.patch to restore + cleanup routines in case of an error (bsc#1151630) + ------------------------------------------------------------------- Thu Aug 22 12:27:18 UTC 2019 - Dr. Werner Fink diff --git a/tcsh.spec b/tcsh.spec index 3bbdba0..f5891d6 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -41,6 +41,8 @@ Patch10: tcsh-6.18.03-history-merge.dif Patch11: tcsh-6.19.00-history-file-locking-order.patch # PATCH-FIX-SUSE Aoid dot locking as patch 9 and 11 do the job better Patch12: tcsh-6.20.00-avoid-dotlock-for-fcntl.patch +# PATCH-FIX-SUSE Restore cleaning routines in case of an error (bsc#1151630) +Patch13: tcsh-6.18.01-history-stderror-jmp.patch BuildRequires: autoconf BuildRequires: fdupes BuildRequires: ncurses-devel @@ -71,6 +73,7 @@ correction, a history mechanism, job control, and a C-like syntax. %patch10 -b .histmerg %patch11 -b .histlckord %patch12 -p0 -b .nodtlck +%patch13 -p0 -b .histerrjmp %patch0 -b .0 %build