Fix for bug boo#1153839

OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=85
This commit is contained in:
Dr. Werner Fink 2019-10-14 08:38:26 +00:00 committed by Git OBS Bridge
parent 6318af0ded
commit 70dcde09e3
3 changed files with 23 additions and 10 deletions

View File

@ -25,25 +25,32 @@
}
cleanup_push(&unit, open_cleanup);
@@ -2229,6 +2231,7 @@ dosource_flg(Char **t, struct command *c
@@ -2225,7 +2227,7 @@ dosource(Char **t, struct command *c)
int
dosource_flg(Char **t, struct command *c, int flg)
{
- Char *f;
+ Char *f, **globbed;
char *file;
int fd;
int newflg = 0;
+ size_t omark;
USE(c);
t++;
@@ -2249,9 +2252,12 @@ dosource_flg(Char **t, struct command *c
@@ -2248,12 +2253,17 @@ dosource_flg(Char **t, struct command *c
cleanup_push(file, xfree);
xfree(f);
t = glob_all_or_error(t);
cleanup_push(t, blk_cleanup);
+ omark = cleanup_push_mark();
- cleanup_push(t, blk_cleanup);
+ globbed = t;
+ cleanup_push(globbed, blk_cleanup);
fd = srcfile(file, 0, (flg | newflg), t);
- if ((!fd) && (!newflg) && (!bequiet))
+ if ((!fd) && (!newflg) && (!bequiet)) {
+ omark = cleanup_push_mark();
+ (void)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(globbed);
+ blk_cleanup(globbed);
cleanup_ignore(file);
xfree(file);

View File

@ -40,7 +40,7 @@
}
#define USE_JENKINS_HASH 1
@@ -1353,5 +1353,16 @@ void
@@ -1358,5 +1358,16 @@ void
sethistory(int n)
{
histlen = n;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 14 08:34:04 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Fix patch tcsh-6.18.01-history-stderror-jmp.patch to avoid
breaks in sourcing standard system files (boo#1153839)
-------------------------------------------------------------------
Thu Sep 26 07:39:20 UTC 2019 - Dr. Werner Fink <werner@suse.de>