Compare commits

...

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

14 changed files with 170 additions and 3 deletions

15
.gitignore vendored
View File

@ -1 +1,14 @@
SOURCES/screen-4.6.2.tar.gz
screen-4.0.3.tar.gz
/screen-20101110git066b098.tar.bz2
/screen-20110328git8cf5ef.tar.bz2
/screen-20110819git450e8f.tar.bz2
/screen-20120314git3c2946.tar.bz2
/screen-4.2.1.tar.gz
/screen-4.3.1.tar.gz
/screen-4.4.0.tar.gz
/screen-4.5.0.tar.gz
/screen-4.5.1.tar.gz
/screen.pam
/screen-4.6.0.tar.gz
/screen-4.6.1.tar.gz
/screen-4.6.2.tar.gz

View File

@ -1 +0,0 @@
0434d4c45d0b5bb339551511e10a9b2c4ec6a789 SOURCES/screen-4.6.2.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

130
screen-4.6.2-covscan.patch Normal file
View File

@ -0,0 +1,130 @@
From 87325f653bc352452008530680ee89c41413ee55 Mon Sep 17 00:00:00 2001
From: Vaclav Dolezal <vdolezal@redhat.com>
Date: Mon, 12 Aug 2019 10:41:33 +0200
Subject: [PATCH] Fix some bugs reported by Covscan
* Fix file descriptor leak
* Fix for nomem handling in resize.c:ChangeWindowSize()
* Fix possible unterminated string
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
---
pty.c | 8 +++++++-
resize.c | 45 +++++++++++++++++++++------------------------
socket.c | 4 +++-
3 files changed, 31 insertions(+), 26 deletions(-)
diff --git a/pty.c b/pty.c
index 1c0660e..eba3bb0 100644
--- a/pty.c
+++ b/pty.c
@@ -279,7 +279,13 @@ char **ttyn;
return -1;
}
signal(SIGCHLD, sigcld);
- strncpy(TtyName, m, sizeof(TtyName));
+ if (strlen(m) < sizeof(TtyName))
+ strcpy(TtyName, m);
+ else
+ {
+ close(f);
+ return -1;
+ }
initmaster(f);
*ttyn = TtyName;
return f;
diff --git a/resize.c b/resize.c
index fc4ddb9..33e9b81 100644
--- a/resize.c
+++ b/resize.c
@@ -928,6 +928,7 @@ int wi, he, hi;
free((char *)p->w_hlines);
p->w_hlines = nhlines;
#endif
+ nmlines = nhlines = 0;
/* change tabs */
if (p->w_width != wi)
@@ -937,30 +938,7 @@ int wi, he, hi;
t = p->w_tabs ? p->w_width : 0;
p->w_tabs = xrealloc(p->w_tabs, wi + 1);
if (p->w_tabs == 0)
- {
- nomem:
- if (nmlines)
- {
- for (ty = he + hi - 1; ty >= 0; ty--)
- {
- mlt = NEWWIN(ty);
- FreeMline(mlt);
- }
- if (nmlines && p->w_mlines != nmlines)
- free((char *)nmlines);
-#ifdef COPY_PASTE
- if (nhlines && p->w_hlines != nhlines)
- free((char *)nhlines);
-#endif
- }
- KillWindow(p);
- Msg(0, "%s", strnomem);
- if (nmlines)
- free(nmlines);
- if (nhlines)
- free(nhlines);
- return -1;
- }
+ goto nomem;
for (; t < wi; t++)
p->w_tabs[t] = t && !(t & 7) ? 1 : 0;
p->w_tabs[wi] = 0;
@@ -1050,6 +1028,25 @@ int wi, he, hi;
}
#endif
return 0;
+
+nomem:
+ if (nmlines || nhlines)
+ {
+ for (ty = he + hi - 1; ty >= 0; ty--)
+ {
+ mlt = NEWWIN(ty);
+ FreeMline(mlt);
+ }
+ if (nmlines && p->w_mlines != nmlines)
+ free((char *)nmlines);
+#ifdef COPY_PASTE
+ if (nhlines && p->w_hlines != nhlines)
+ free((char *)nhlines);
+#endif
+ }
+ KillWindow(p);
+ Msg(0, "%s", strnomem);
+ return -1;
}
void
diff --git a/socket.c b/socket.c
index 88c3dd8..ebf55f9 100644
--- a/socket.c
+++ b/socket.c
@@ -720,7 +720,7 @@ struct NewWindow *nwin;
if (getcwd(m.m.create.dir, sizeof(m.m.create.dir)) == 0)
{
Msg(errno, "getcwd");
- return;
+ goto end;
}
if (nwin->term != nwin_undef.term)
strncpy(m.m.create.screenterm, nwin->term, MAXTERMLEN);
@@ -729,6 +729,8 @@ struct NewWindow *nwin;
debug1("SendCreateMsg writing '%s'\n", m.m.create.line);
if (write(s, (char *) &m, sizeof m) != sizeof m)
Msg(errno, "write");
+
+end:
close(s);
}
--
2.20.1

14
screen-altscreen.patch Normal file
View File

@ -0,0 +1,14 @@
diff --git a/ansi.c b/ansi.c
index e76eef4..bbdc119 100644
--- a/ansi.c
+++ b/ansi.c
@@ -1444,8 +1444,8 @@ int c, intermediate;
else
{
if (curr->w_alt.on) {
- LeaveAltScreen(curr);
RestoreCursor(&curr->w_alt.cursor);
+ LeaveAltScreen(curr);
}
}
if (a1 == 47 && !i)

View File

@ -4,7 +4,7 @@
Summary: A screen manager that supports multiple logins on one terminal
Name: screen
Version: 4.6.2
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv3+
URL: http://www.gnu.org/software/screen
Requires(pre): /usr/sbin/groupadd
@ -26,6 +26,7 @@ Patch3: screen-E3.patch
Patch4: screen-4.3.1-suppress_remap.patch
Patch5: screen-4.3.1-crypt.patch
Patch6: screen-4.5.1-texinfo.patch
Patch7: screen-4.6.2-covscan.patch
%description
The screen utility allows you to have multiple logins on just one
@ -131,6 +132,9 @@ fi
%endif
%changelog
* Mon Nov 25 2019 Václav Doležal <vdolezal@redhat.com> - 4.6.2-5
- Fix some issues reported by covscan (#1602686)
* Mon Aug 13 2018 Václav Doležal <vdolezal@redhat.com> - 4.6.2-4
- Change license to GPLv3+ (#1615619)

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (screen-4.6.2.tar.gz) = 224bd16ad5ae501d1b8bb7d2ba9cc19e6a0743de5a5b320109c2f6bf3b1ca564cc7094ed9211be13733d9d769cde77d13fe236341d448cad0518038ab1e85c99