Update to tcsh 6.22.01 - 20191201

OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=89
This commit is contained in:
Dr. Werner Fink 2019-12-02 08:28:24 +00:00 committed by Git OBS Bridge
parent d582af6155
commit 4bf28f7390
11 changed files with 101 additions and 120 deletions

View File

@ -7,7 +7,7 @@
--- sh.c
+++ sh.c 2016-11-25 08:02:39.616478025 +0000
@@ -862,9 +862,9 @@ main(int argc, char **argv)
@@ -863,9 +863,9 @@ main(int argc, char **argv)
/* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
#if defined(DSPMBYTE)
#if defined(NLS) && defined(LC_CTYPE)

View File

@ -4,7 +4,7 @@
--- sh.c
+++ sh.c 2019-09-26 07:54:47.733054241 +0000
@@ -1563,13 +1563,15 @@ srcfile(const char *f, int onlyown, int
@@ -1571,13 +1571,15 @@ srcfile(const char *f, int onlyown, int
fl.l_len = 0;
hd = xmalloc(sizeof(*hd));
@ -25,7 +25,7 @@
}
cleanup_push(&unit, open_cleanup);
@@ -2225,7 +2227,7 @@ dosource(Char **t, struct command *c)
@@ -2233,7 +2235,7 @@ dosource(Char **t, struct command *c)
int
dosource_flg(Char **t, struct command *c, int flg)
{
@ -34,7 +34,7 @@
char *file;
int fd;
int newflg = 0;
@@ -2248,12 +2253,17 @@ dosource_flg(Char **t, struct command *c
@@ -2256,12 +2258,17 @@ dosource_flg(Char **t, struct command *c
cleanup_push(file, xfree);
xfree(f);
t = glob_all_or_error(t);

View File

@ -4,7 +4,7 @@
--- sh.c
+++ sh.c 2016-11-25 08:05:00.501610199 +0000
@@ -1541,18 +1541,18 @@ int
@@ -1549,18 +1549,18 @@ int
#endif /*WINNT_NATIVE*/
srcfile(const char *f, int onlyown, int flg, Char **av)
{
@ -31,7 +31,7 @@
if (flg & (HIST_FILE_WRLCK | HIST_FILE_RDLCK)) {
struct flock fl;
@@ -1562,26 +1562,35 @@ srcfile(const char *f, int onlyown, int
@@ -1570,26 +1570,35 @@ srcfile(const char *f, int onlyown, int
fl.l_start = 0;
fl.l_len = 0;

View File

@ -3,24 +3,24 @@
1 file changed, 6 insertions(+)
--- sh.hist.c
+++ sh.hist.c 2017-07-19 10:01:20.795354927 +0000
@@ -1278,6 +1278,11 @@ rechist(Char *fname, int ref)
}
+++ sh.hist.c 2019-11-29 14:28:04.960116108 +0000
@@ -1275,6 +1275,11 @@ rechist(Char *fname, int ref)
if (merge) {
+#if 0 /* We are using fcntl's F_SETLKW patch for locking
+ * therefore avoid dot file locking without holding
+ * a file descriptor as otherwise we migth not be
+ * able to open the history file after a crash or
+ * if a killall had been used during reboot. */
jmp_buf_t osetexit;
+#if 0 /* We are using fcntl's F_SETLKW patch for locking
+ * therefore avoid dot file locking without holding
+ * a file descriptor as otherwise we migth not be
+ * able to open the history file after a crash or
+ * if a killall had been used during reboot. */
if (lock) {
#ifndef WINNT_NATIVE
char *lockpath = strsave(short2str(fname));
@@ -1287,6 +1292,7 @@ rechist(Char *fname, int ref)
@@ -1284,6 +1289,7 @@ rechist(Char *fname, int ref)
cleanup_push(lockpath, dotlock_cleanup);
#endif
}
+#endif
/* Read .history file, leave it's fd open for writing. */
fd = loadhist(fname, HIST_MERGE|HIST_FILE_WRLCK|HIST_FILE_OPEN|HIST_FILE_LOCK);
if (fd > 0) {
getexit(osetexit);
if (setexit()) {
/* Read .history file, leave it's fd open for writing. */

View File

@ -14,18 +14,18 @@ https://bugzilla.redhat.com/show_bug.cgi?id=879371
Changes by Fridolin Pokorny <fpokorny@redhat.com>
---
sh.c | 102 ++++++++++++++++++++++++++++++++++++------------
sh.c | 102 +++++++++++++++++++++++++++++++++++-------------
sh.decls.h | 4 +
sh.dol.c | 2
sh.err.c | 16 +++++++
sh.h | 18 ++++++++
sh.hist.c | 127 ++++++++++++++++++++++++++++---------------------------------
sh.hist.c | 129 +++++++++++++++++++++++++++++--------------------------------
sh.lex.c | 8 +--
sh.sem.c | 2
8 files changed, 178 insertions(+), 101 deletions(-)
8 files changed, 180 insertions(+), 101 deletions(-)
--- sh.c
+++ sh.c 2019-08-22 13:02:31.780361102 +0000
+++ sh.c 2019-11-29 14:09:30.432768187 +0000
@@ -138,6 +138,7 @@ struct saved_state {
int cantell;
struct Bin B;
@ -34,7 +34,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
};
static int srccat (Char *, Char *);
@@ -1359,7 +1360,7 @@ main(int argc, char **argv)
@@ -1360,7 +1361,7 @@ main(int argc, char **argv)
/*
* Source history before .login so that it is available in .login
*/
@ -43,7 +43,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
#ifndef LOGINFIRST
if (loginsh)
(void) srccat(varval(STRhome), STRsldotlogin);
@@ -1508,7 +1509,7 @@ static int
@@ -1516,7 +1517,7 @@ static int
srccat(Char *cp, Char *dp)
{
if (cp[0] == '/' && cp[1] == '\0')
@ -52,7 +52,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
else {
Char *ep;
char *ptr;
@@ -1524,7 +1525,7 @@ srccat(Char *cp, Char *dp)
@@ -1532,7 +1533,7 @@ srccat(Char *cp, Char *dp)
cleanup_push(ep, xfree);
ptr = short2str(ep);
@ -61,7 +61,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
cleanup_until(ep);
return rv;
}
@@ -1538,20 +1539,49 @@ static int
@@ -1546,20 +1547,49 @@ static int
#else
int
#endif /*WINNT_NATIVE*/
@ -123,7 +123,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
}
@@ -1560,7 +1590,7 @@ srcfile(const char *f, int onlyown, int
@@ -1568,7 +1598,7 @@ srcfile(const char *f, int onlyown, int
* fd.
*/
static void
@ -132,7 +132,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
{
st->insource = insource;
st->SHIN = SHIN;
@@ -1609,10 +1639,14 @@ st_save(struct saved_state *st, int unit
@@ -1617,10 +1647,14 @@ st_save(struct saved_state *st, int unit
st->onelflg = onelflg;
st->enterhist = enterhist;
st->justpr = justpr;
@ -148,7 +148,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
st->cantell = cantell;
cpybin(st->B, B);
@@ -1651,7 +1685,7 @@ st_save(struct saved_state *st, int unit
@@ -1659,7 +1693,7 @@ st_save(struct saved_state *st, int unit
evalp = 0;
alvec = al;
alvecp = 0;
@ -157,7 +157,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
if (enterhist)
HIST = '\0';
insource = 1;
@@ -1684,7 +1718,8 @@ st_restore(void *xst)
@@ -1692,7 +1726,8 @@ st_restore(void *xst)
}
cpybin(B, st->B);
@ -167,7 +167,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
insource = st->insource;
SHIN = st->SHIN;
@@ -1720,7 +1755,7 @@ st_restore(void *xst)
@@ -1728,7 +1763,7 @@ st_restore(void *xst)
* we don't chance it. This occurs on ".cshrc"s and the like.
*/
static void
@ -176,7 +176,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
{
struct saved_state st;
@@ -1746,7 +1781,7 @@ srcunit(int unit, int onlyown, int hflg,
@@ -1754,7 +1789,7 @@ srcunit(int unit, int onlyown, int hflg,
}
/* Save the current state and move us to a new state */
@ -185,7 +185,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
/*
* Now if we are allowing commands to be interrupted, we let ourselves be
@@ -2088,7 +2123,7 @@ process(int catch)
@@ -2096,7 +2131,7 @@ process(int catch)
* elsewhere...
*/
if (enterhist || (catch && intty && !whyles && !tellwhat && !arun))
@ -194,7 +194,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
if (Expand && seterr)
Expand = 0;
@@ -2175,21 +2210,28 @@ process(int catch)
@@ -2183,21 +2218,28 @@ process(int catch)
void
dosource(Char **t, struct command *c)
{
@ -226,7 +226,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
}
f = globone(*t++, G_ERROR);
@@ -2198,9 +2240,15 @@ dosource(Char **t, struct command *c)
@@ -2206,9 +2248,15 @@ dosource(Char **t, struct command *c)
xfree(f);
t = glob_all_or_error(t);
cleanup_push(t, blk_cleanup);
@ -245,7 +245,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
/*
--- sh.decls.h
+++ sh.decls.h 2019-08-22 13:02:31.780361102 +0000
+++ sh.decls.h 2019-11-29 14:09:30.432768187 +0000
@@ -37,6 +37,7 @@
*/
extern Char *gethdir (const Char *);
@ -272,7 +272,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
extern void sethistory (int);
--- sh.dol.c
+++ sh.dol.c 2019-08-22 13:02:31.780361102 +0000
+++ sh.dol.c 2019-11-29 14:09:30.432768187 +0000
@@ -1117,6 +1117,6 @@ again:
*obp = 0;
tmp = short2str(obuf);
@ -282,8 +282,8 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
cleanup_until(&inheredoc);
}
--- sh.err.c
+++ sh.err.c 2019-08-22 13:02:31.780361102 +0000
@@ -511,6 +511,22 @@ open_cleanup(void *xptr)
+++ sh.err.c 2019-11-29 14:09:30.432768187 +0000
@@ -512,6 +512,22 @@ open_cleanup(void *xptr)
}
void
@ -307,7 +307,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
{
DIR *dir;
--- sh.h
+++ sh.h 2019-08-22 13:02:31.784361027 +0000
+++ sh.h 2019-11-29 14:09:30.432768187 +0000
@@ -49,6 +49,24 @@
# include <inttypes.h>
#endif
@ -334,7 +334,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
typedef unsigned long intptr_t;
#endif
--- sh.hist.c
+++ sh.hist.c 2019-08-22 13:02:44.684119766 +0000
+++ sh.hist.c 2019-11-29 14:22:17.850548114 +0000
@@ -32,6 +32,8 @@
#include "sh.h"
#include <stdio.h> /* for rename(2), grr. */
@ -531,26 +531,30 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
rechist(Char *fname, int ref)
{
- Char *snum, *rs;
- int fp, ftmp, oldidfds, phup_disabled_tmp;
- int fp, ftmp, oldidfds;
+ Char *snum;
+ int fd = -1, ftmp, oldidfds, phup_disabled_tmp;
+ int fd = -1, ftmp, oldidfds;
struct varent *shist;
- char path[MAXPATHLEN];
struct stat st;
static Char *dumphist[] = {STRhistory, STRmhT, 0, 0};
@@ -1294,52 +1287,50 @@ rechist(Char *fname, int ref)
cleanup_push(lockpath, dotlock_cleanup);
@@ -1292,52 +1285,52 @@ rechist(Char *fname, int ref)
#endif
}
- loadhist(fname, 1);
+ /* Read .history file, leave it's fd open for writing. */
+ fd = loadhist(fname, HIST_MERGE|HIST_FILE_WRLCK|HIST_FILE_OPEN|HIST_FILE_LOCK);
+ if (fd > 0) {
+ /* Truncate the .history file. */
+ (void) ftruncate(fd, 0);
+ (void) lseek(fd, (off_t) 0, SEEK_SET);
getexit(osetexit);
- if (setexit())
- loadhist(fname, 1);
+ if (setexit()) {
+ /* Read .history file, leave it's fd open for writing. */
+ fd = loadhist(fname, HIST_MERGE|HIST_FILE_WRLCK|HIST_FILE_OPEN|HIST_FILE_LOCK);
+ if (fd > 0) {
+ /* Truncate the .history file. */
+ (void) ftruncate(fd, 0);
+ (void) lseek(fd, (off_t) 0, SEEK_SET);
+ }
+ }
resexit(osetexit);
}
}
- rs = randsuf();
@ -561,7 +565,6 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
- if (fp == -1) {
- didfds = oldidfds;
- cleanup_until(fname);
- phup_disabled = phup_disabled_tmp;
- return;
+ if (fd <= 0) {
+ /* Open .history file for writing (if not open yet). */
@ -600,7 +603,6 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
- (void)ReplaceFile( short2str(fname),path,NULL,0,NULL,NULL);
-#endif
cleanup_until(fname);
phup_disabled = phup_disabled_tmp;
}
@ -617,7 +619,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
if (fname != NULL)
loadhist_cmd[2] = fname;
@@ -1348,17 +1339,19 @@ loadhist(Char *fname, int mflg)
@@ -1346,17 +1339,19 @@ loadhist(Char *fname, int mflg)
else
loadhist_cmd[2] = STRtildothist;
@ -642,7 +644,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
void
--- sh.lex.c
+++ sh.lex.c 2019-08-22 13:02:31.784361027 +0000
+++ sh.lex.c 2019-11-29 14:09:30.432768187 +0000
@@ -1608,7 +1608,7 @@ wide_read(int fildes, Char *buf, size_t
/* Throwing away possible partial multibyte characters on error if the
stream is not seekable */
@ -680,7 +682,7 @@ Changes by Fridolin Pokorny <fpokorny@redhat.com>
fbuf = xcalloc(2, sizeof(Char **));
fblocks = 1;
--- sh.sem.c
+++ sh.sem.c 2019-08-22 13:02:31.784361027 +0000
+++ sh.sem.c 2019-11-29 14:09:30.432768187 +0000
@@ -905,7 +905,7 @@ doio(struct command *t, int *pipein, int
fd = xopen(tmp, O_WRONLY|O_APPEND|O_LARGEFILE);
#else /* !O_APPEND */

View File

@ -1,50 +0,0 @@
tcsh can deadlock with itself if savehist is confgured with "merge" and
"lock", and two SIGHUPs are received in rapid succession. The
mechanism of the deadlock is the first SIGHUP triggers a rechist() and
while that rechist() is executing (and after it has created the lock
file), another SIGHUP triggers a another rechist() which then waits
forever for the lock the the first rechist() created to be released
(which will never happen).
---
tcsh-6.21.00/sh.hist.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- tcsh-6.21.00/sh.hist.c
+++ tcsh-6.21.00/sh.hist.c 2019-08-22 12:05:25.800474245 +0000
@@ -1219,7 +1219,7 @@ void
rechist(Char *fname, int ref)
{
Char *snum, *rs;
- int fp, ftmp, oldidfds;
+ int fp, ftmp, oldidfds, phup_disabled_tmp;
struct varent *shist;
char path[MAXPATHLEN];
struct stat st;
@@ -1227,6 +1227,10 @@ rechist(Char *fname, int ref)
if (fname == NULL && !ref)
return;
+
+ phup_disabled_tmp = phup_disabled;
+ phup_disabled = 1;
+
/*
* If $savehist is just set, we use the value of $history
* else we use the value in $savehist
@@ -1301,6 +1305,7 @@ rechist(Char *fname, int ref)
if (fp == -1) {
didfds = oldidfds;
cleanup_until(fname);
+ phup_disabled = phup_disabled_tmp;
return;
}
/* Try to preserve ownership and permissions of the original history file */
@@ -1325,6 +1330,7 @@ rechist(Char *fname, int ref)
(void)ReplaceFile( short2str(fname),path,NULL,0,NULL,NULL);
#endif
cleanup_until(fname);
+ phup_disabled = phup_disabled_tmp;
}

View File

@ -14,7 +14,7 @@
--- config/linux
+++ config/linux 2019-05-09 08:41:54.237060106 +0000
@@ -92,6 +92,9 @@
@@ -99,6 +99,9 @@
#ifndef _SVID_SOURCE
# define _SVID_SOURCE
#endif
@ -24,7 +24,7 @@
#ifndef _POSIX_SOURCE
# define _POSIX_SOURCE
#endif
@@ -132,4 +135,11 @@
@@ -139,4 +142,11 @@
# define POSIX
#endif
@ -93,7 +93,7 @@
--- sh.c
+++ sh.c 2019-05-09 08:41:54.237060106 +0000
@@ -1346,6 +1346,9 @@ main(int argc, char **argv)
@@ -1347,6 +1347,9 @@ main(int argc, char **argv)
setintr = osetintr;
parintr = oparintr;
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c438325448371f59b12a4c93bfd3f6982e6f79f8c5aef4bc83aac8f62766e972
size 1001909

3
tcsh-6.22.01.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e38e709a62cd769918e1cce96512ceca72d72b2c3bbf392b28e3db8a8b79f173
size 1006407

View File

@ -1,3 +1,35 @@
-------------------------------------------------------------------
Mon Dec 2 08:26:48 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Update to tcsh bug fix version V6.22.01 - 20191201
* undo PR/88: Preserve empty arguments in :q, since it breaks
$ set x=""
$ alias test "echo "\""$x:q"\"" is working."
$ alias test
echo "
-------------------------------------------------------------------
Fri Nov 29 14:44:02 UTC 2019 - Dr. Werner Fink <werner@suse.de>
- Update to tcsh bug fix version V6.22.00 - 20191128
* PR/113: Sobomax: avoid infinite loops for -c commands when stdout is
not a tty.
* Avoid infinite loops during history loads when merging, print a better
error for errors during history load.
* PR/88: Preserve empty arguments in :q
* PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE)
* PR/81: Fix range matching issue where we were comparing with the
range character instead of the start of range. [l-z]* would match foo
- Drop patch tcsh-6.21.00-sighup-deadlock.patch as now superfluous
- Port patches
* tcsh-6.17.06-dspmbyte.dif
* tcsh-6.18.01-history-stderror-jmp.patch
* tcsh-6.19.00-history-file-locking-order.patch
* tcsh-6.20.00-avoid-dotlock-for-fcntl.patch
* tcsh-6.21.0-history-file-locking.patch
* tcsh-6.21.00-sighup-deadlock.patch
* tcsh-6.21.00.dif
-------------------------------------------------------------------
Thu Oct 17 10:35:23 UTC 2019 - Dr. Werner Fink <werner@suse.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package tcsh
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,13 +17,13 @@
Name: tcsh
Version: 6.21.00
Version: 6.22.01
Release: 0
Summary: The C SHell
License: BSD-3-Clause
Group: System/Shells
Url: http://www.tcsh.org/
Source: ftp.astron.com:/pub/tcsh/tcsh-6.21.00.tar.gz
URL: http://www.tcsh.org/
Source: ftp.astron.com:/pub/%{name}/%{name}-%{version}.tar.gz
Source2: bindkey.tcsh
Source3: complete.tcsh
Patch0: tcsh-6.21.00.dif
@ -32,8 +32,6 @@ Patch2: tcsh-6.16.00-norm-cmd.dif
Patch4: tcsh-6.18.03-colorls.dif
Patch5: tcsh-6.17.06-dspmbyte.dif
Patch6: tcsh-6.18.03-catalogs.dif
# PATCH-FIX-UPSTREAM Do not (re)run SIGHUP handler during rewrite history
Patch7: tcsh-6.21.00-sighup-deadlock.patch
# PATCH-FIX-SUSE add history file locking (bsc#901076)
Patch9: tcsh-6.21.0-history-file-locking.patch
Patch10: tcsh-6.18.03-history-merge.dif
@ -68,7 +66,6 @@ correction, a history mechanism, job control, and a C-like syntax.
%patch4 -b .colorls
%patch5 -b .dspmbyte
%patch6 -b .catalogs
%patch7 -p1 -b .sighup
%patch9 -b .histlock
%patch10 -b .histmerg
%patch11 -b .histlckord