summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2017-02-11 00:57:15 +0000
committercy <cy@FreeBSD.org>2017-02-11 00:57:15 +0000
commit76f9420d2e411d0f16d50359987d84e6f0054277 (patch)
tree65c42ec2b887d321211f1258c5f51d9804a3af08
parentb18daf7791c25b5ea4032e7f9e3eabff6ecf8ac4 (diff)
downloadFreeBSD-ports-76f9420d2e411d0f16d50359987d84e6f0054277.zip
FreeBSD-ports-76f9420d2e411d0f16d50359987d84e6f0054277.tar.gz
Fix a segfault in utmp.c when performing a windowlist move (,).
Reported by: Alex Naumov <alexander_naumov@opensuse.org> See also: https://savannah.gnu.org/bugs/?50143
-rw-r--r--sysutils/screen/Makefile2
-rw-r--r--sysutils/screen/files/patch-utmp.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/sysutils/screen/Makefile b/sysutils/screen/Makefile
index 423ee5c..01cf4b3 100644
--- a/sysutils/screen/Makefile
+++ b/sysutils/screen/Makefile
@@ -3,7 +3,7 @@
PORTNAME= screen
PORTVERSION= 4.5.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= http://ftp.gnu.org/gnu/screen/ \
ftp://ftp.gnu.org/gnu/screen/ \
diff --git a/sysutils/screen/files/patch-utmp.c b/sysutils/screen/files/patch-utmp.c
index 53edc3f..6e72f2f 100644
--- a/sysutils/screen/files/patch-utmp.c
+++ b/sysutils/screen/files/patch-utmp.c
@@ -1,5 +1,5 @@
---- utmp.c.orig 2016-06-19 12:41:03.000000000 -0700
-+++ utmp.c 2016-06-21 04:10:22.500131000 -0700
+--- utmp.c.orig 2017-01-17 11:28:29.397404660 -0800
++++ utmp.c 2017-02-10 16:48:34.902236000 -0800
@@ -26,6 +26,7 @@
****************************************************************
*/
@@ -21,7 +21,7 @@
wi->w_slot = (slot_t)0;
if (!utmpok || wi->w_type != W_TYPE_PTY)
-@@ -435,51 +430,12 @@
+@@ -435,51 +430,13 @@
makeuser(&u, stripdev(wi->w_tty), LoginName, wi->w_pid);
#ifdef UTHOST
@@ -66,7 +66,8 @@
-
# if !defined(_SEQUENT_) && !defined(sequent)
- strncpy(u.ut_host, host, sizeof(u.ut_host));
-+ strncpy(u.ut_host, D_loginhost, sizeof(u.ut_host));
++ if(display)
++ strncpy(u.ut_host, D_loginhost, sizeof(u.ut_host));
# endif
#endif /* UTHOST */
@@ -75,7 +76,7 @@
{
Msg(errno,"Could not write %s", UtmpName);
UT_CLOSE;
-@@ -598,7 +554,7 @@
+@@ -598,7 +555,7 @@
struct utmp *u;
{
u->ut_type = DEAD_PROCESS;
@@ -84,7 +85,7 @@
u->ut_exit.e_termination = 0;
u->ut_exit.e_exit = 0;
#endif
-@@ -631,7 +587,11 @@
+@@ -631,7 +588,11 @@
/* must use temp variable because of NetBSD/sparc64, where
* ut_xtime is long(64) but time_t is int(32) */
(void)time(&now);
@@ -97,7 +98,7 @@
}
static slot_t
-@@ -743,7 +703,11 @@
+@@ -743,7 +704,11 @@
strncpy(u->ut_line, line, sizeof(u->ut_line));
strncpy(u->ut_name, user, sizeof(u->ut_name));
(void)time(&now);
OpenPOWER on IntegriCloud